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

Fix KBDPad MKI backlight, Num Lock LEDs; clean up firmware a bit #6883

Merged
merged 5 commits into from
Nov 3, 2019
Merged

Fix KBDPad MKI backlight, Num Lock LEDs; clean up firmware a bit #6883

merged 5 commits into from
Nov 3, 2019

Conversation

bcat
Copy link
Contributor

@bcat bcat commented Oct 3, 2019

Description

  • Made Num Lock LED work. It's wired to its own I/O pin and not controlled by the regular backlight pin. (Tested on physical PCB ;Num Lock LED works independent of backlight.)

  • Use standard backlight implementation, including hardware PWM for breathing. (Tested on physical PCB; brightness and breathing work.)

  • Replace RGB underglow with standard ps2avrgb driver and add appropriate config so it just works if someone enables it. Leaving it off by default since the stock case makes the underglow almost invisible (but the LEDs are there on the PCB).

  • Turned off command by default since the QMK docs caution against having it default on, and there wasn't a working IS_COMMAND defined anyway. (No shift keys, so the default doesn't work.)

  • Remove some unnecessary/default config options.

  • Add store URL to QMK Configurator and readme.

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

  • KBDPad MKI doesn't support numlock LED.
  • KBDPad MKI doesn't support backlight brightness control or breathing.

Checklist

  • My code follows the code style of this project.
  • 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).

@bcat
Copy link
Contributor Author

bcat commented Oct 3, 2019

If someone can tell me how to test the info.json change locally, that would be much appreciated. :) I copied the layout JSON from another keeb with identical layout support, so it should be fine, but I'd feel better having tested it.

@fauxpark
Copy link
Member

fauxpark commented Oct 3, 2019

You can test the info.json by hitting Control+Shift+I in the Configurator :)

@fauxpark fauxpark requested a review from a team October 3, 2019 05:44
@bcat bcat changed the title Clean up KBDPad MKI firmware and default keymap Fix KBDPad MKI backlight, clean up firmware and default keymap Oct 3, 2019
keyboards/kbdfans/kbdpad/mk1/mk1.h Outdated Show resolved Hide resolved
keyboards/kbdfans/kbdpad/mk1/rules.mk Outdated Show resolved Hide resolved
@yanfali yanfali added the configurator affects configurator label Oct 3, 2019
Copy link
Contributor

@yanfali yanfali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't remove LAYOUTs, that breaks configurator default keymaps in configurator. You can use the #define LAYOUT trick in the layout macro list.

@bcat
Copy link
Contributor Author

bcat commented Oct 3, 2019

@fauxpark Confirmed info.json loads in configurator, thanks!

@yanfali I am not sure I understand, sorry. Does the configurator requires a layout called LAYOUT? Or is it that a layout can't ever be renamed? (I assume as long as the merged keymaps in the QMK repo still built, we were good, but I guess probably lots of folks save JSON from the configurator and never check it in.)

I'm happy to re-add the old layout macro in addition to the ortho_6x4 (the "all" layout for this PCB) and numpad_6x4 layouts, but does this mean I'm stuck calling it LAYOUT? I guess if I rename it this will also break the configurator?

Thinking a little bit more about this, maybe I should split this PR into two: one for the backlight fixes and mk1.c cleanups, and the other for the layout and info.json changes. But I don't have a good sense of desirable PR size for QMK, so I'm good either way.

@yanfali
Copy link
Contributor

yanfali commented Oct 3, 2019

@bcat it's because configurator can't get keymaps reliably from the API at this time, so there's a separate repo in configurator which contains default keymaps for every keyboard. If you remove a layout that keymap will not load and break configurator. For cases like that we recommed you add a #define alias in the keyboard.h file that maps the old name to the new one to satisfy the API.

e.g.

#define LAYOUT LAYOUT_newly_defined_layout_name_that matches_old_one

we do not recommend changing the default at all, as this just confuses users, it's ok to add new ones, but we are trying to be more backward compatible with old names because we've had a history of arbitrarily breaking them without updating configurator.

Alternately. You can also update the configurator repo, if you are insistent on removing a LAYOUT. But this needs to be done around the same time to avoid breakage in the UI.

@fauxpark
Copy link
Member

fauxpark commented Oct 3, 2019

It seems like there is no default keymap submitted for the mkI though, so I don't think there is any issue with that... but you also have the option to import keymap.json files which will break if the layout they specify is missing. There may also be C keymaps in the wild using LAYOUT.

If you want to get rid of it in favour of the more descriptive ones, it should be done in a separate PR that will go through the breaking changes process.

@bcat
Copy link
Contributor Author

bcat commented Oct 3, 2019

@yanfali @fauxpark Thanks, this explanation is super helpful. I didn't actually know there was a separate repo with the configurator defaults, and I also wasn't thinking about JSON keymaps, since those don't get checked into GitHub but it would suck to just break them. So I will go ahead and revert the layout changes for now. (I might send a separate PR later to add the community layouts, but I'll make sure I don't break the existing one.)

Should I put this info somewhere? Maybe the breaking changes docs? As a QMK n00b it wasn't super obvious to me what backwards compatibility obligations existed beyond "make sure the keymaps in the QMK repo still compile". (I see the docs do mention not breaking keymaps, but I wrongly assumed it meant submitted keymaps only.)

@bcat bcat changed the title Fix KBDPad MKI backlight, clean up firmware and default keymap Fix KBDPad MKI backlight, Num Lock LEDs; clean up firmware a bit Oct 4, 2019
@bcat
Copy link
Contributor Author

bcat commented Oct 4, 2019

Reverted layout changes for this PR, sorry for the hassle!

Copy link
Contributor

@yanfali yanfali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@yanfali yanfali removed the configurator affects configurator label Oct 4, 2019
@bcat bcat requested a review from mechmerlin October 7, 2019 23:14
@drashna
Copy link
Member

drashna commented Oct 8, 2019

@mechmerlin had some objections here. I'd like to see him weigh in again.

@bcat
Copy link
Contributor Author

bcat commented Oct 15, 2019

Friendly ping for @mechmerlin. I think the only open question was around the RGB changes. I would slightly prefer to have the cleanups in because the PCB does have RGB LEDs wired stock and there's already some RGB code checked in.

However, if you object to this I can revert the RGB changes and just leave the backlight fixes. Up to you, just let me know.

@bcat
Copy link
Contributor Author

bcat commented Nov 2, 2019

Reworked this PR to use the new ps2avrGB RGB driver. Seems much cleaner now. I can still remove the RGB bits entirely if you folks want, but since all it takes is two config.h settings and one rules.mk setting to make the PCB's built-in RGB ready to use if someone does want it, I'm slightly inclined to leave it in if that's cool with y'all.

I gave my KBDPad away as a gift to a family member and hence while I've built the reworked version of this PR (and there are no changes from the last known working version except the new RGB driver), I have not tested the latest hex yet. Gonna ask said family member if they mind reflashing, but it may be a couple days. (Alternatively, if one of the reviewers has a KBDPad and doesn't mind sanity checking this, that'd be much appreciated. I'm always scared of submitting untested code....)

Copy link
Member

@zvecr zvecr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fauxpark
Copy link
Member

fauxpark commented Nov 3, 2019

Thanks!

@fauxpark fauxpark merged commit 732d1dd into qmk:master Nov 3, 2019
@bcat bcat deleted the bcat_kbdpad branch November 3, 2019 22:42
ripxorip pushed a commit to ripxorip/qmk_firmware that referenced this pull request Dec 3, 2019
…#6883)

* Update keyboard kit URL

* Replace custom RGB driver with new one from qmk#7183

* Replace backlight with standard impl

* Remove some unnecessary default settings

* Disable COMMAND since docs want it off by default

(There's no working IS_COMMAND set for this board anyway, so it's
already a nop.)
patrl pushed a commit to patrl/qmk_firmware that referenced this pull request Dec 29, 2019
…#6883)

* Update keyboard kit URL

* Replace custom RGB driver with new one from qmk#7183

* Replace backlight with standard impl

* Remove some unnecessary default settings

* Disable COMMAND since docs want it off by default

(There's no working IS_COMMAND set for this board anyway, so it's
already a nop.)
HokieGeek pushed a commit to HokieGeek/qmk_firmware that referenced this pull request Feb 21, 2020
…#6883)

* Update keyboard kit URL

* Replace custom RGB driver with new one from qmk#7183

* Replace backlight with standard impl

* Remove some unnecessary default settings

* Disable COMMAND since docs want it off by default

(There's no working IS_COMMAND set for this board anyway, so it's
already a nop.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants