-
-
Notifications
You must be signed in to change notification settings - Fork 39.3k
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
Optical keyboard #17852
Optical keyboard #17852
Conversation
M quantum/matrix.c
M quantum/matrix.c
M quantum/matrix.c
Keyboard suitable for Gateron optical switches. Columns are Output pins that drive Led and PT, while row pins are Input pins that read status (0 if key not pressed, 1 if pressed) A keyboards/opticalkb/blackpill_f401.c A keyboards/opticalkb/chconf.h A keyboards/opticalkb/config.h A keyboards/opticalkb/halconf.h A keyboards/opticalkb/info.json A keyboards/opticalkb/keymaps/default/keymap.c A keyboards/opticalkb/keymaps/default/readme.md A keyboards/opticalkb/matrix.c A keyboards/opticalkb/mcuconf.h A keyboards/opticalkb/opticalkb.c A keyboards/opticalkb/opticalkb.h A keyboards/opticalkb/readme.md A keyboards/opticalkb/rules.mk
M keyboards/opticalkb/readme.md
Lint has flagged a few issues. Please resolve. |
Also, add an option to use pullup at PT M keyboards/opticalkb/config.h M keyboards/opticalkb/info.json M keyboards/opticalkb/matrix.c M keyboards/opticalkb/rules.mk
Fixed the lint issue |
Thanks, I fixed and committed (it says it cannot generate info.json, and I
found a bug in the naming of keyboard to match dir name)
…On Sun, 31 Jul 2022 at 01:53, Drashna Jaelre ***@***.***> wrote:
Lint has flagged a few issues. Please resolve.
—
Reply to this email directly, view it on GitHub
<#17852 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD6DOYHVAJFV5BBLUAWEYC3VWW6BLANCNFSM55DSS4CA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
M keyboards/opticalkb/config.h M keyboards/opticalkb/matrix.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- should use custom matrix "lite"
- currently not implementing debounce correctly
- unnecessary duplication of code
- info.json render does not match keyboard layout
I am using an optical matrix. Optical switches do not need debounce. It takes about 15us for phototransistor to rise and IO pin will read accurate values after that. I get stable switching even at very high scan rates (delay of 20us between reading columns). Debounce code is not applicable here. No need to keep 2 matrix copies and deal with timers. This will slow down scan rate.
The duplication is unavoidable unless code is refactored in matrix_common
I need some help here. How is this checked? I see 5x15 keys in info.json and it matches matrix definition |
D keyboards/opticalkb/blackpill_f401.c D keyboards/opticalkb/chconf.h D keyboards/opticalkb/halconf.h M keyboards/opticalkb/info.json M keyboards/opticalkb/keymaps/default/keymap.c D keyboards/opticalkb/mcuconf.h M keyboards/opticalkb/rules.mk
Hello Joel, I made the changes you requested and commited. I have some
questions, please see the github page.
…On Sun, 31 Jul 2022 at 16:50, Joel Challis ***@***.***> wrote:
***@***.**** requested changes on this pull request.
- should use custom matrix "lite"
- currently not implementing debounce correctly
- unnecessary duplication of code
- info.json render does not match keyboard layout
------------------------------
In keyboards/opticalkb/blackpill_f401.c
<#17852 (comment)>:
> @@ -0,0 +1,23 @@
+/* Copyright 2020 Sergey Vlasov (sigprof)
File should be deleted
------------------------------
In keyboards/opticalkb/rules.mk
<#17852 (comment)>:
> +CONSOLE_ENABLE = no # Console for debug
+COMMAND_ENABLE = no # Commands for debug and configuration
+NKRO_ENABLE = no # Enable N-Key Rollover
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
+RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
+AUDIO_ENABLE = no # Audio output
+DYNAMIC_MACRO_ENABLE = yes # Dynamic macros
+
+LED_MATRIX_ENABLE = no
+
+# turn this off after debugging
+# CONSOLE_ENABLE = yes
+
+# https://github.com/qmk/qmk_firmware/blob/master/docs/custom_matrix.md
+CUSTOM_MATRIX = yes
+SRC += matrix.c blackpill_f401.c
⬇️ Suggested change
-SRC += matrix.c blackpill_f401.c
+SRC += matrix.c
------------------------------
In keyboards/opticalkb/mcuconf.h
<#17852 (comment)>:
> @@ -0,0 +1,30 @@
+/* Copyright 2020 QMK
File should be removed
------------------------------
In keyboards/opticalkb/halconf.h
<#17852 (comment)>:
> @@ -0,0 +1,28 @@
+/* Copyright 2020 QMK
File should be removed
------------------------------
In keyboards/opticalkb/chconf.h
<#17852 (comment)>:
> @@ -0,0 +1,40 @@
+/* Copyright 2020 QMK
File should be removed
—
Reply to this email directly, view it on GitHub
<#17852 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD6DOYETZ4T7QR5UHPJ53UDVW2HD5ANCNFSM55DSS4CA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
M keyboards/opticalkb/config.h M keyboards/opticalkb/info.json M keyboards/opticalkb/keymaps/default/keymap.c M keyboards/opticalkb/rules.mk
You should still implement it correctly, but set the
Using |
does not represent what is shown in |
Created a rev1 directory and moved keyboard files there. This creates flexibility to add another revision to keyboard. Changed matrix implementation to 'lite' as requested Fixed info.json to reflext pcb geometry RM keyboards/opticalkb/config.h -> keyboards/opticalkb/rev1/config.h RM keyboards/opticalkb/info.json -> keyboards/opticalkb/rev1/info.json R keyboards/opticalkb/keymaps/default/keymap.c -> keyboards/opticalkb/rev1/keymaps/default/keymap.c R keyboards/opticalkb/keymaps/default/readme.md -> keyboards/opticalkb/rev1/keymaps/default/readme.md RM keyboards/opticalkb/matrix.c -> keyboards/opticalkb/rev1/matrix.c RM keyboards/opticalkb/readme.md -> keyboards/opticalkb/rev1/readme.md RM keyboards/opticalkb/opticalkb.c -> keyboards/opticalkb/rev1/rev1.c R keyboards/opticalkb/opticalkb.h -> keyboards/opticalkb/rev1/rev1.h RM keyboards/opticalkb/rules.mk -> keyboards/opticalkb/rev1/rules.mk
All suggested changes requested in pull request review M keyboards/opticalkb/rev1/config.h M keyboards/opticalkb/rev1/info.json M keyboards/opticalkb/rev1/keymaps/default/keymap.c M keyboards/opticalkb/rev1/matrix.c M keyboards/opticalkb/rev1/readme.md M keyboards/opticalkb/rev1/rev1.c M keyboards/opticalkb/rev1/rules.mk
Thanks, changed it. I am not sure how I can verify this graphically though, but changed the geometry values |
Thanks, changed as requested. I am glad setting DEBOUNCE to 0 eliminates all debouce related processing |
M keyboards/opticalkb/rev1/readme.md M keyboards/opticalkb/rev1/rules.mk
Thank you, I think I have incorporated all suggestions |
To reduce power consumption one can increase time during which IR is not powered M keyboards/opticalkb/rev1/matrix.c
Please review and merge, thanks :) |
This keyboard code references a different pcb, https://github.com/girishji/optical-keyboard-mx. The components on this keyboard pcb reflect the delay times embedded in the scan matrix. config.h, info.json and keymap files have been changed to reflect new pin connections on blackpill as well as slightly different thumb cluster. M keyboards/opticalkb/rev1/config.h M keyboards/opticalkb/rev1/info.json M keyboards/opticalkb/rev1/keymaps/default/keymap.c M keyboards/opticalkb/rev1/matrix.c M keyboards/opticalkb/rev1/readme.md M keyboards/opticalkb/rev1/rev1.h M keyboards/opticalkb/rev1/rules.mk
M keyboards/opticalkb/rev1/readme.md
M keyboards/opticalkb/rev1/readme.md
- Remove config related to FS USB since it is included by default - Remove RGB animation config - Simplify keymap; Users can add bells and whistles as they wish M keyboards/opticalkb/rev1/config.h M keyboards/opticalkb/rev1/keymaps/default/keymap.c
- Remove unwanted lines - Add comments to compile flags M keyboards/opticalkb/rev1/rules.mk
Thank you for your contribution! |
Co-authored-by: Ryan <fauxpark@gmail.com>
Thank you for your contribution! |
Thank you for your contribution! |
Optical keyboard with Ergo layout
Description
This is an optical matrix keyboard corresponding to pcb here: https://github.com/girishji/optical-keyboard. It uses Gateron optical switches with a blackpill stm32f401 mcu. There is also a custom matrix to drive the Led's and PT's.
Types of Changes
Issues Fixed or Closed by This PR
Checklist