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

Bring dactyl/matrix.c in line with quantum/matrix.c #2613

Merged
merged 13 commits into from
Apr 27, 2018

Conversation

ErinCall
Copy link
Contributor

@ErinCall ErinCall commented Mar 25, 2018

This is the first big step toward #2065. It updates keyboards/handwired/dactyl/matrix.c to look like quantum/matrix.c:

  • use the updated debounce algorithm
  • Rows are called "rows" and columns are called "columns"
  • Support for MATRIX_MASKED
  • Support for DIODE_DIRECTION
  • The big one: support for COL_PINS/ROW_PINS arrays. It's currently broken into ONBOARD_ROW_PINS/ONBOARD_COL_PINS and EXPANDER_ROW_PINS/EXPANDER_COL_PINS. I don't love that design, but it works and I haven't figured out a better one.

The next step will be to port these changes back into quantum/matrix.c.

cc @drashna

This incorporates the fixed/optimized debounce code added to
quantum/matrix.c in:

* 508eddf
* 4c69608
* 32f88c0
* f403028
* a06115d
With a column-driven keyboard, reading from the mcp23081 returns a
column-state, which takes some extra work to translate into the
row-state used in the actual matrix. The ergodox_ez code sidestepped
that problem by calling rows "columns" and columns "rows." With this
change, the dactyl now calls rows "rows" and columns "columns."
Bonus: saves one i2c transaction per matrix_scan!
This entirely doesn't matter. The PORT values are set during
init_keyboard and never change. They're repeatedly set to the same
thing. These PORT lines shouldn't even exist, but since they do, they
should at least look right.
I honestly don't know whether/how well this code works with other I/O
expanders, but at least in theory, it should be generic enough to work
with others. Given that, the variable names shouldn't refer to a
specific model of expander.
It's commented out in quantum/matrix.c, and the dactyl has no power
up/down behavior beyond being unplugged (which goes to matrix_init), so
there's no sense keeping it around.
...and rename input_mask to expander_input_mask, since now that it isn't
scoped to init_expander it isn't clear that it's only for the expander.
@drashna
Copy link
Member

drashna commented Mar 26, 2018

Nice!

Also, if the matrix is the same as the Ergodox, you should check out the recently added "pretty" layouts for the Ergodox.

@drashna
Copy link
Member

drashna commented Apr 24, 2018

Was this ready to be merged?

@ErinCall
Copy link
Contributor Author

Yeah, I think it's good to go.

@jackhumbert jackhumbert merged commit 050c21d into qmk:master Apr 27, 2018
@jackhumbert
Copy link
Member

Awesome - thanks!

carlpehrson pushed a commit to carlpehrson/qmk_firmware that referenced this pull request May 7, 2018
* Use the new debounce algorithm in dactyl/matrix.c [qmk#2065]

This incorporates the fixed/optimized debounce code added to
quantum/matrix.c in:

* 508eddf
* 4c69608
* 32f88c0
* f403028
* a06115d

* Fix the row/column swap in dactyl [qmk#2065]

With a column-driven keyboard, reading from the mcp23081 returns a
column-state, which takes some extra work to translate into the
row-state used in the actual matrix. The ergodox_ez code sidestepped
that problem by calling rows "columns" and columns "rows." With this
change, the dactyl now calls rows "rows" and columns "columns."

* Cleanup: variable names, documentation [qmk#2065]

* Support MATRIX_MASKED in dactyl/matrix.c [qmk#2065]

* Only unselect one col in unselect_col [qmk#2065]

Bonus: saves one i2c transaction per matrix_scan!

* Implement COL2ROW in dactyl/matrix.c [qmk#2065]

* Fix a typo in dactyl/matrix.c

This entirely doesn't matter. The PORT values are set during
init_keyboard and never change. They're repeatedly set to the same
thing. These PORT lines shouldn't even exist, but since they do, they
should at least look right.

* Implement COL_PINS/ROW_PINS for dactyl [qmk#2065]

* Rename "mcp23018" to "expander" [qmk#2065]

I honestly don't know whether/how well this code works with other I/O
expanders, but at least in theory, it should be generic enough to work
with others. Given that, the variable names shouldn't refer to a
specific model of expander.

* Remove matrix_power_up from dactyl/matrix.c [qmk#2065]

It's commented out in quantum/matrix.c, and the dactyl has no power
up/down behavior beyond being unplugged (which goes to matrix_init), so
there's no sense keeping it around.

* Only initialize expander_input_mask once [qmk#2065]

...and rename input_mask to expander_input_mask, since now that it isn't
scoped to init_expander it isn't clear that it's only for the expander.
@ErinCall ErinCall deleted the custom-matrix-like-quantum-matrix branch August 1, 2018 00:55
akatrevorjay added a commit to akatrevorjay/qmk_firmware that referenced this pull request Oct 8, 2018
* 'master' of git://github.com/qmk/qmk_firmware: (105 commits)
  Add dz60 iso layout with vim-style arrows (qmk#2837)
  Fix Clicky Down code
  Addkeymap/tada fakb (qmk#2830)
  Add knops mini info json and implemented latest QMK standards (qmk#2832)
  Add RGB keymap to UT47 (qmk#2826)
  QMK Configurator updates to Tada68 (qmk#2825)
  Add keymap diagram (qmk#2819)
  QMK Configurator updates for Mechmini v2 (qmk#2820)
  QMK Configurator Support (qmk#2821)
  QMK Configurator Support for HHKB and Staryu (qmk#2823)
  Fix UT47 matrix (qmk#2824)
  Updated tri-layer block in keymap file. (qmk#2827)
  Add missing 7U and 4U layouts to 2x1800 (qmk#2829)
  New Numpad Support: naKey from ckeys.org (qmk#2828)
  Bring dactyl/matrix.c in line with quantum/matrix.c (qmk#2613)
  FC660C Configurator Support (qmk#2817)
  avocado toast change (qmk#2816)
  QMK Configurator Support MF68 (qmk#2815)
  More QMK Configurator Support for Pearl (qmk#2814)
  Keymap Fixes for 7U layout, RGB and Audio support (qmk#2779)
  ...
hauleth pushed a commit to hauleth/qmk_firmware that referenced this pull request Jan 24, 2019
* Use the new debounce algorithm in dactyl/matrix.c [qmk#2065]

This incorporates the fixed/optimized debounce code added to
quantum/matrix.c in:

* 508eddf
* 4c69608
* 32f88c0
* f403028
* a06115d

* Fix the row/column swap in dactyl [qmk#2065]

With a column-driven keyboard, reading from the mcp23081 returns a
column-state, which takes some extra work to translate into the
row-state used in the actual matrix. The ergodox_ez code sidestepped
that problem by calling rows "columns" and columns "rows." With this
change, the dactyl now calls rows "rows" and columns "columns."

* Cleanup: variable names, documentation [qmk#2065]

* Support MATRIX_MASKED in dactyl/matrix.c [qmk#2065]

* Only unselect one col in unselect_col [qmk#2065]

Bonus: saves one i2c transaction per matrix_scan!

* Implement COL2ROW in dactyl/matrix.c [qmk#2065]

* Fix a typo in dactyl/matrix.c

This entirely doesn't matter. The PORT values are set during
init_keyboard and never change. They're repeatedly set to the same
thing. These PORT lines shouldn't even exist, but since they do, they
should at least look right.

* Implement COL_PINS/ROW_PINS for dactyl [qmk#2065]

* Rename "mcp23018" to "expander" [qmk#2065]

I honestly don't know whether/how well this code works with other I/O
expanders, but at least in theory, it should be generic enough to work
with others. Given that, the variable names shouldn't refer to a
specific model of expander.

* Remove matrix_power_up from dactyl/matrix.c [qmk#2065]

It's commented out in quantum/matrix.c, and the dactyl has no power
up/down behavior beyond being unplugged (which goes to matrix_init), so
there's no sense keeping it around.

* Only initialize expander_input_mask once [qmk#2065]

...and rename input_mask to expander_input_mask, since now that it isn't
scoped to init_expander it isn't clear that it's only for the expander.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants