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

[Keymap] Improvements to KidBrazil keymap to better handle OLED/LED Matrix timeout. #7688

Merged
merged 12 commits into from
Jan 8, 2020

Conversation

kidBrazil
Copy link
Contributor

@kidBrazil kidBrazil commented Dec 20, 2019

Description

The purpose of this PR is to improve the behaviour of the OLED and LED Matrix timeouts introduced in the original PR for this keymap. With this PR the user will actually be able to toggle the RGB matrix on/off and have it stay that way when the keyboard wakes up.

Apparently rgbmatrix info is not readily available to pull from the eeprom so my approach was to initialize the keyboard to a known state and use some volatile booleans to store the current state while the keyboard is powered up.

  • Timeout is now broken into 2 stages, stage 1 sets both halves to display the logo, stage 2 turns off both the OLED screen and the RGB Matrix.
  • MASTER OLED gets cleared once during the first stage to ensure no artifacts left over on screen.
  • Added process_records catch for RGB_TOG to modify standard behaviour and make it work with the variables set in the keymap. All other keys are still set to wake up the CRKBD from dormant state

Types of Changes

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

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).

kidBrazil and others added 11 commits December 13, 2019 15:35
-Custom Font
-Custom OLED output
* Setup Oled timeout based on simple timer

* Cleaned up comments and added timeout for LEDs

* Fixed some small errors

* Updated oled timout with matrix scan

* Updated oled timout with matrix scan

* Update withou eeprom

* Update timer code

* Use process user instead of keymap

* Added ifdef to protect oledtimer

* Updated with half timeout state for logo

* Removed middle tier timer
- Added boolean to hold LED state
- Added init function to set rgb to known state
- Modified RGB_TOG to work with noeeprom commands
@kidBrazil kidBrazil force-pushed the kidbrazil/oled-timeout-improvements branch from 16b5997 to 19e7051 Compare December 20, 2019 17:26
@noroadsleft noroadsleft requested a review from a team January 3, 2020 23:20
@kidBrazil
Copy link
Contributor Author

@noroadsleft I commited your suggestion via the browser, not sure it took yet. Cant seem to see it on the diff so I will fix it manually and request a review again. Cheers

user has disabled it via RGB_TOG.

## Flashing
To flash this on your CRKBD simply use the `make crkbd:kidbrazil:flash`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like it worked!

@noroadsleft noroadsleft merged commit fdc144d into qmk:master Jan 8, 2020
@noroadsleft
Copy link
Member

Thanks!

HokieGeek pushed a commit to HokieGeek/qmk_firmware that referenced this pull request Feb 21, 2020
…atrix timeout. (qmk#7688)

* Added KidBrazil custom keymap for CRKBD
-Custom Font
-Custom OLED output

* Added missing readme

* Oled Timeout Update for KidBrazil Keymap (qmk#1)

* Setup Oled timeout based on simple timer

* Cleaned up comments and added timeout for LEDs

* Fixed some small errors

* Updated oled timout with matrix scan

* Updated oled timout with matrix scan

* Update withou eeprom

* Update timer code

* Use process user instead of keymap

* Added ifdef to protect oledtimer

* Updated with half timeout state for logo

* Removed middle tier timer

* Final cleanup of unused files

* Updated code as per suggestions & requests

* Second round of revisions

* Updated keymap to better handle LED timeout
- Added boolean to hold LED state
- Added init function to set rgb to known state
- Modified RGB_TOG to work with noeeprom commands

* Finished adding the timeout for OLED and testing on CRKBD

* Updated documentation

* fixed the timeout logic so it works as intended

* Update keyboards/crkbd/keymaps/kidbrazil/README.md
kylekuj pushed a commit to kylekuj/qmk_firmware that referenced this pull request Apr 21, 2020
…atrix timeout. (qmk#7688)

* Added KidBrazil custom keymap for CRKBD
-Custom Font
-Custom OLED output

* Added missing readme

* Oled Timeout Update for KidBrazil Keymap (qmk#1)

* Setup Oled timeout based on simple timer

* Cleaned up comments and added timeout for LEDs

* Fixed some small errors

* Updated oled timout with matrix scan

* Updated oled timout with matrix scan

* Update withou eeprom

* Update timer code

* Use process user instead of keymap

* Added ifdef to protect oledtimer

* Updated with half timeout state for logo

* Removed middle tier timer

* Final cleanup of unused files

* Updated code as per suggestions & requests

* Second round of revisions

* Updated keymap to better handle LED timeout
- Added boolean to hold LED state
- Added init function to set rgb to known state
- Modified RGB_TOG to work with noeeprom commands

* Finished adding the timeout for OLED and testing on CRKBD

* Updated documentation

* fixed the timeout logic so it works as intended

* Update keyboards/crkbd/keymaps/kidbrazil/README.md
if (record->event.pressed) {
#ifdef OLED_DRIVER_ENABLE
oled_timer = timer_read32();
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a logic bug here. Although the variable is named oled_timer, it's used to timeout both the RGB Matrix and the OLEDs. As it's written, disabling the OLEDs will break the RGB Matrix timeout because oled_timer will not be set.

To resolve it, I recommend renaming oled_timer to timeout_timer and remove the conditional ifdef here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants