Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keyboard Q1 #13397

Merged
merged 9 commits into from
Jul 24, 2021
Merged

Add keyboard Q1 #13397

merged 9 commits into from
Jul 24, 2021

Conversation

lokher
Copy link
Contributor

@lokher lokher commented Jul 1, 2021

Description

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added keyboard keymap via Adds via keymap and/or updates keyboard for via support labels Jul 1, 2021
keyboards/keychron/q1/q1.c Outdated Show resolved Hide resolved
keyboards/keychron/q1/readme.md Outdated Show resolved Hide resolved
keyboards/keychron/q1/rev_0100/rules.mk Outdated Show resolved Hide resolved
keyboards/keychron/q1/config.h Show resolved Hide resolved
lokher and others added 2 commits July 1, 2021 20:24
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
keyboards/keychron/q1/readme.md Outdated Show resolved Hide resolved
lokher and others added 2 commits July 2, 2021 07:17
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
@sigprof
Copy link
Contributor

sigprof commented Jul 4, 2021

Did you test the behavior of the keyboard when the DIP switch is closed, and you try to put the computer into a sleep/suspend state? I suspect that the keyboard will immediately wake up the computer in this case, because the DIP switch is a part of the matrix, and anything which looks like a pressed key will be considered as a wakeup request.

You may be able to work around this problem by using the obscure MATRIX_MASKED feature:

  1. Enable the feature in config.h:
#define MATRIX_MASKED
  1. Configure the mask in q1.c:
const matrix_row_t matrix_mask[] = {
    0b0111111111111101,
    0b0111111111111111,
    0b0111111111111111,
    0b0111111111111111,
    0b0111111111111111,
    0b0111111111111111,
};

(the bit at {0, 1} needs to be reset to 0, so that the DIP switch state would be masked away).

The matrix mask affects matrix_get_row() and any dependent functions (such as wakeup check and key event processing), but does not affect peek_matrix(), which is used by the DIP switch code to get the matrix state.

keyboards/keychron/q1/rev_0100/info.json Outdated Show resolved Hide resolved
Co-authored-by: Ryan <fauxpark@gmail.com>
@lokher
Copy link
Contributor Author

lokher commented Jul 5, 2021

I did some tests 2 minutes ago, and the computer stayed in sleep/suspend state what ever the DIP switch state was. The DIP switch dosen't send any keycode in my firmware, I don't think it can wake up the computer.
Thank you for reminding.

Did you test the behavior of the keyboard when the DIP switch is closed, and you try to put the computer into a sleep/suspend state? I suspect that the keyboard will immediately wake up the computer in this case, because the DIP switch is a part of the matrix, and anything which looks like a pressed key will be considered as a wakeup request.

You may be able to work around this problem by using the obscure MATRIX_MASKED feature:

  1. Enable the feature in config.h:
#define MATRIX_MASKED
  1. Configure the mask in q1.c:
const matrix_row_t matrix_mask[] = {
    0b0111111111111101,
    0b0111111111111111,
    0b0111111111111111,
    0b0111111111111111,
    0b0111111111111111,
    0b0111111111111111,
};

(the bit at {0, 1} needs to be reset to 0, so that the DIP switch state would be masked away).

The matrix mask affects matrix_get_row() and any dependent functions (such as wakeup check and key event processing), but does not affect peek_matrix(), which is used by the DIP switch code to get the matrix state.

keyboards/keychron/q1/q1.c Outdated Show resolved Hide resolved
@drashna drashna requested review from a team, fauxpark and noroadsleft July 20, 2021 06:01
Added keyboards\q1\rev_0100\readme.md
Changed keyboards\q1\readme.md since different MCU may used in other version.
@lokher lokher requested a review from drashna July 21, 2021 01:17
@drashna
Copy link
Member

drashna commented Jul 24, 2021

Thanks!

@drashna drashna merged commit 145d89a into qmk:master Jul 24, 2021
cadusk pushed a commit to cadusk/qmk_firmware that referenced this pull request Jul 24, 2021
* qmk/develop: (33 commits)
  [Keyboard] Add Keychron Q1 (qmk#13397)
  [Keymap] add kinesis/keymaps/jwon (qmk#13618)
  [Keyboard] Dharma (qmk#13663)
  feature: Add swap hands support for sofle keyboard. (qmk#13654)
  Fix up xd002 rgb keymaps (qmk#13685)
  Avoid LTO conficts on arm_atsam (qmk#13676)
  [Keyboard] Reduce compile size for dz60rgb v2.1 (qmk#13680)
  [Keyboard] Fix type on pandora via keymap (qmk#13681)
  Remove deprecated callbacks for encoders and dip switches (qmk#13404)
  [Keyboard] Quick hack to fix Astro65 board (qmk#13665)
  [Keyboard] Added Compound keyboard support (qmk#12942)
  Disables rgblight twinkle by default. (qmk#13677)
  [Keyboard] Fix split matrix for sekigon grs 70ec (qmk#13672)
  [Keyboard] Fix matrix delay on Drop boards (qmk#13671)
  [Keyboard] Disable console by default on all Keebio boards (qmk#13649)
  CLI/Docs: Fix the format commands' name (qmk#13668)
  [Keyboard] Enable LTO by default on BastardKB Scylla (qmk#13664)
  [Keyboard] Fix symmetric70_proto build break on develop branch (qmk#13667)
  [Keyboard] Remove broken, unmaintained converter/ibm_5291 (qmk#13658)
  [Keyboard] Add model-v keyboard (qmk#13643)
  ...
@lokher lokher mentioned this pull request Aug 6, 2021
6 tasks
nhongooi pushed a commit to nhongooi/qmk_firmware that referenced this pull request Dec 5, 2021
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keyboard keymap via Adds via keymap and/or updates keyboard for via support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants