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

[WIP] Helix keyboard Compile time OLED, RGBLIGHT on/off control #5

Closed
wants to merge 3 commits into from

Conversation

mtei
Copy link

@mtei mtei commented Mar 14, 2018

相談しながら詰めていきたいので、[WIP] 付けてます。
(WIP = Work In Progress、未完成の状態でプルリクエストを出して
GitHub 上でコメントのやりとりをしながら、プルリクエストを完成させていくやり方だそうです。 試しに実行してみます。)

以下のようにコンパイル時に make コマンドのオプションによって、OLED の有る無し、
RGBLED の個数を指定できるようにする改造です。
生成されるファームのバイナリは従来通りです。

 $ make helix/default                       -- OLED off, RGBRIGHT off
 $ make OLED=yes helix/default              -- OLED on, RGBRIGHT off
 $ make RGBLED=under helix/default          -- OLED off, RGBRIGHT underglow
 $ make RGBLED=back helix/default           -- OLED off, RGBRIGHT backlight
 $ make OLED=yes RGBLED=back helix/default  -- OLED on, RGBRIGHT backlight

この方法、いかがでしょうか?

 $ make helix/default                       -- OLED off, RGBRIGHT off
 $ make OLED=yes helix/default              -- OLED on, RGBRIGHT off
 $ make RGBLED=under helix/default          -- OLED off, RGBRIGHT underglow
 $ make RGBLED=back helix/default           -- OLED off, RGBRIGHT backlight
 $ make OLED=yes RGBLED=back helix/default  -- OLED on, RGBRIGHT backlight
@mtei
Copy link
Author

mtei commented Mar 14, 2018

この変更を、もし採用するとして、
ここで気になるのが、qmk_firmware/keyboards/helix/rev2/config.h にある

#define RGBLED_NUM 12 // Number of LEDs

と、qmk_firmware/keyboards/helix/rev2/keymaps/default/config.h にある

#undef RGBLED_NUM
です。
この二つは消してしまってはダメでしょうか?

@mtei
Copy link
Author

mtei commented Mar 14, 2018

あと、とりあえず、merge先を master にしてしまいましたが、必要なら、ないさんの方で merge 用のブランチを作っていただいて、プルリクエスト出しなおします。

mtei added 2 commits March 15, 2018 03:48
…dd Error check and add Help target

display help message:         $ make helix:default:help

OLED off, RGBRIGHT off:       $ make             helix:default
OLED on,  RGBRIGHT off:       $ make OLED=yes    helix:default
OLED off, RGBRIGHT underglow: $ make LED=under   helix:default
        and no animation    : $ make LED=underna helix:default
OLED off, RGBRIGHT backlight: $ make LED=back    helix:default
        and no animation    : $ make LED=backna  helix:default
OLED on,  RGBRIGHT backlight: $ make OLED=yes LED=back   helix:default
        and no animation    : $ make OLED=yes LED=backna helix:default
@mtei
Copy link
Author

mtei commented Mar 15, 2018

LED の no animation を指定できるように変更しました。
テストしていて、自分で RGBLED=xxx を typo してはまってしまったので、
LED=xxx に変更し、xxx の部分の間違った指定を検知するように直しました。
make の help メッセージも出せるようにしました。

display help message:         $ make helix:default:help

OLED off, RGBRIGHT off:       $ make             helix:default
OLED on,  RGBRIGHT off:       $ make OLED=yes    helix:default
OLED off, RGBRIGHT underglow: $ make LED=under   helix:default
        and no animation    : $ make LED=underna helix:default
OLED off, RGBRIGHT backlight: $ make LED=back    helix:default
        and no animation    : $ make LED=backna  helix:default
OLED on,  RGBRIGHT backlight: $ make OLED=yes LED=back   helix:default
        and no animation    : $ make OLED=yes LED=backna helix:default

@MakotoKurauchi
Copy link
Owner

rules.mkに

OLED_ENABLE = no
RGBLED_ENABLE = no

がデフォルトで入っているように出来ますか?
毎回コマンドで入れるのは面倒なので、rules.mkでも変更できるようにしたいです。

@mtei
Copy link
Author

mtei commented Mar 17, 2018

なるほど、常用的に同じ組み合わせで作りたいから、毎回コマンドラインで指定するのが面倒臭いということですね。
このパッチを作ったのは、編集してしまうと git commit の時、どちらも no にいちいち戻すのが面倒臭いというところが発想の出発点だったのですが。

では、上のコマンドラインで指定する方式は無しにして、代わりにこんなアイデアはどうでしょうか?

rules.mk では、helix_option.mk の存在をチェックし、存在するなら include するように変更する。
helix_option.mk は、git でコミットするファイルとしては作らない、代わりに以下のファイルを用意する。

helix_option-oled.mk, helix_option-backled.mk, .... その他ありうる組み合わせ全部

ユーザーは OLED off, LED off 以外の組み合わせで作りたい場合は、
copy helix_option-希望の組み合わせ.mk helix_option.h
を実行してから make を実行する。

この方向でよければ、この PullReq は一旦閉じて、改めて作り直して PullReq だします。

@MakotoKurauchi
Copy link
Owner

yesにしたり戻すのが面倒ならstashを使えばよいのではないでしょうか?
その方法が使いやすいものになるのかよく分かりません。

@mtei
Copy link
Author

mtei commented Mar 18, 2018

git stash は、このケースではあんまり使いたく無いんです。
ブランチの作業途中での stash と、どうせ消す stash を混ぜたく無いので。
(要するに git stash drop を気軽に使うのに抵抗があるんです。)

ともあれ、make コマンド呼び出し時の引数の追加で指定するのは煩わしいというのは了解しました。

私としては、OLED と LED の切り替えの度に rules.mk と config.h の両方をいじるのは
なんとか避けたいので、新たな提案をあらたな PullRequest としてもう一度だします。
(もちろん、ないんさんの判断でそれも却下でも、了承しますが、まずは見ていただいて。)

@mtei mtei closed this Mar 18, 2018
@mtei mtei deleted the helix-rgb-compile-sw branch March 21, 2018 10:04
MakotoKurauchi pushed a commit that referenced this pull request Feb 26, 2019
* Draft commit of typing speed RGB control

* More information in the readme

* Support all RGB animation modes (Fixes #1)

* Added support for all RGB light modes to use typing speed

Except christmas lights because that is seizure-inducing at high speeds!

* Introduced a value range specific to each RGB mode

Because some modes are a little too much when running at full speed!

* Update readme.md

* Update readme.md

* Re-arrange typing_speed definitions (Fixes #5) (#6)

* Re-arrange variable definitions to avoid including quantum.h from rgblight.c

* Fix a compilation error when trying to run make test:all

* Tweaks to the typing speed decay rate

* Renamed to momentum; moved implementation into dedicated files

* Groundwork for toggling momentum on/off (currently always on)

* Add EEPROM toggle for momentum-matching

* Moved momentum out of RGBLIGHT_ENABLE toggles so it's more generic

* Move momentum decay task out of rgblight_task()

* Fix missing momentum.h in lufa.c

* Experimental LED support (untested)

* Draft commit of typing speed RGB control

* More information in the readme

* Support all RGB animation modes (Fixes #1)

* Added support for all RGB light modes to use typing speed

Except christmas lights because that is seizure-inducing at high speeds!

* Introduced a value range specific to each RGB mode

Because some modes are a little too much when running at full speed!

* Update readme.md

* Update readme.md

* Re-arrange typing_speed definitions (Fixes #5) (#6)

* Re-arrange variable definitions to avoid including quantum.h from rgblight.c

* Fix a compilation error when trying to run make test:all

* Tweaks to the typing speed decay rate

* Renamed to momentum; moved implementation into dedicated files

* Groundwork for toggling momentum on/off (currently always on)

* Add EEPROM toggle for momentum-matching

* Moved momentum out of RGBLIGHT_ENABLE toggles so it's more generic

* Move momentum decay task out of rgblight_task()

* Fix missing momentum.h in lufa.c

* Added documentation

* Renamed feature to velocikey

* Reverted readme to original state

* Correct the readme title

* Updated feature name in the docs

* Update EECONFIG name

* Add compile-time toggles for velocikey

* Update feature documentation

* Revert "Merge branch 'led-support' into master"

This reverts commit e123ff5, reversing
changes made to df111a5.

* Move velocikey EECONFIG definition to depend on VELOCIKEY_ENABLE

* Rename decay_task function to decelerate

* Apply suggestions from code review

Co-Authored-By: chrislewisdev <[email protected]>

* Re-order eeconfig definitions

* Apply coding conventions

* Apply #ifdef check in lufa.c

* Refactored interval time checks into one functionc

* Small rename

* Fix unused function error for layouts not using all rgb effects

* Only update EEPROM if Velocikey is enabled

* Incorporate code review feedback

* Small adjustment to top-end decay rate

* Add Velocikey documentation to table of contents

* Bring tetris:default keymap size down by disabling audio
MakotoKurauchi pushed a commit that referenced this pull request Apr 9, 2022
* [keyboard] Initial support for Anne Pro 2

* [keyboard][AnnePro2] Keymap:update to a reasonable keymap with caps+hjkl => arrow

* :(

* changed to use HSI

* support for annepro2 c18

* keyboard/annepro2: Very stupid matrix scan bug fix.

* typo

* swap COL14/13

* keyboard/annepro2: startup secondary LED MCU

* keyboard/annepro2: typo fix

* Add IO Values

* Disable Combo feature

* Update default keymap to Anne Pro 2 Official Keymap

* keyboard/annepro2: keymap layer name changes

* keyboard/annepro2 BLE Support

* Fix keymap comment

FN1 ESC was listed as ~ instead of `

* keyboard/annepro2: Bluetooth path

* Keyboard annepro2 bidir led comms (#5)

* Added bidirectional shine comms and moved led functionality to new file

* Added bidirectional shine comms and moved led functionality to new file

* Restore original functionality to existing keymaps using new shine commands

* Fix dangling bracketless if statements

* PR cleanup

* add custom keycodes to switch led profiles

* Optimize code

* switch to prev profile before turning leds off

* Add persistent led support with eeprom (#9)

* adding HT32 support to chibios SPI master driver

* add support for W25X20CL SPI eeprom

* add makefile flag for eeprom feature

* add spi support to keyboard startup and config

* example keymap using eeprom profile loading

* Cleanup to fix C15 eeprom/spi build errors (#11)

* Cleanup to fix C15 eeprom/spi build errors

* add newline at eof

* LED Masking support for Shine

Introduce companion update to ledSetMask and ledClearMask.
In keymap `codetector` there is example of how to map caps_lock
to the caps_lock key light on the keyboard.

* [AnnePro2]: update bluetooth connection

* Merge the custom keys enums on annepro2.h (#13)

* Keyboard annepro2 ble caps lock (#12)

* Move matrix_scan_kb out of board.c to annepro2.c

* add buffer clear after init and caplock polling

* Add support for LED intensity (#15)

* Improve logic for switching off and on of LEDs (#16)

* Implement animation speed (#17)

* Include logic to send solid colors as foreground to shine and add sample profiles (#14)

Include the logic to send a solid color from qmk to shine. That solid color will act as a foreground (will override the current profile) until reset (witch will reactivate the current profile).
This functionality depends on changes made for shine as well.

Include 3 new profiles:

    default-full-caps -> same as default, but with the logic of using the red foreground color on caps lock.
    default-layer-indicators -> same as default, but with the logic of red foreground on caps lock, green foreground on FN1 and blue foreground on FN2.
    thomazmoura -> my own profile as a sample of an over-engineered advanced case scenario.

* Implement reactive lighting effects (#18)

* Added multiarrow keymap (#19)

* Add LED documentation (#26)

* add LED documentation

* add LED documentation to other default profiles

* Implement QMK's IAP default keybind (#29)

* Add keymap for going into IAP

* switch to default QMK keybind for IAP mode

* implement bluetooth IAP mode

* Make default config more like Obins stock default (#30)

* Add new message type for resetting foreground color (#31)

* annepro2(bluetooth): add media keys support (qmk#41)

* Asynchronous, robust serial protocol. (qmk#39)

* bla personal ap2-c18 keymap.

* Bidirectional, asynchronous message-based communication with Shine.

- Requires a matching Shine version.
- Protocol is resiliant to loosing bytes during communication, chips won't lock
  waiting for bytes that aren't coming.
- Chips resynchronize in event of loosing a byte using a AA0D header.

Regressions:
- Key masking/locking doesn't work right now. (did it work before?)
- Not all user keymaps build against it.

* Clang-format + code to ease reducing speed of LED UART.

- Did clang-format --style=file -i on multiple files according to
  coding_conventions_c.md

- Added separate serial speed for IAP boot and Led communication, it's possible
  that reducing this to 9600 helped someone with faulty HW. With this code they
  can do it with simple replacing of a value.

* Main chip can set/clear foreground using a mask mechanism.

- Some preparations for selective colouring.

* Selective mask works - tested on capslock.

- Migrated personal keymaps to new status API.

* Clear the foreground colors to show profile when it's modified.

- Show example of achieving selective caps-lock painting + foreground painting
  for layers.
- annepro2LedMaskSetRow is implemented, but still requires testing.

* Implement the QMK side of led blinking to indicate the command was received.

- This stupidly blinks the key when user presses one of the bluetooth commands
to let the user know that the command was received and forwarded to the BT chip.

- TODO: Row/col key positions are hardcoded and not taken from the keymap.

* Reduce memory footprint.

Applying code review suggestions. Moved msgId to globals - preparing for
transmission without copying payload when no retries are necessary.

Added empty readme.md files - required by QMK lint.

Co-authored-by: Tomasz bla Fortuna <[email protected]>

* Let the LED chip settle a bit before waking it from the bootloader. (qmk#42)

At least for one person that helps to reliably get the LEDs working without
disconnecting/reconnecting the power to the board multiple times.

Co-authored-by: Tomasz bla Fortuna <[email protected]>

* annepro2: rename KEYMAP to LAYOUT, as required by new version of QMK

* annepro2: update ChibiOS configuration files

* annepro2: fix undefined reference to dprint and timer_read32

* annepro2: update ChibiOS MCU name

* update spi driver, fix bad merging with master

* annepro2: add readme and info.json

* annepro2: make code compatible with QMK coding conventions

* tmk_core: temporary fix to allow HT32 based keyboards to work without patched ChibiOS-contrib (AnnePro2)

* AnnePro2: removed core changes

* AnnePro2: Leave only default keymaps

Missing keymaps will be restored in another PR

* annepro2: add licence information

* annepro2: satisfy qmk lint

* annepro2: fix drashna's suggestions

* annepro2: fix matrix

* annepro2: apply code review suggestions

* annepro2: apply remaining code review suggestions

* annepro2: update info.json

* annepro2: remove include

* annepro2: rename keymap to layout

* annepro2: fix typing

* annepro2: apply suggestions from tzarc's code review

Co-authored-by: Nick Brassel <[email protected]>

* annepro2: more fixes

* annepro2: apply suggestions from code review

Co-authored-by: Joel Challis <[email protected]>

* annepro2: rename file

* more fixes

* Apply suggestions from @tzarc code review

Co-authored-by: Nick Brassel <[email protected]>

* Update keyboards/annepro2/protocol.h

Co-authored-by: Nick Brassel <[email protected]>

* Update keyboards/annepro2/chconf.h

Co-authored-by: Nick Brassel <[email protected]>

* apply CR suggestions

* upgrade readme

* IAP

* update IAP comments, defines

* led fix

* init fix

* annepro2: GPIO cleanup

* annepro2: ioline

* change waiting time

* Start develop for 2022q2

* [Core] Squeeze AVR some more with `-mrelax` and `-mcall-prologues` (qmk#16269)

* Rework generate-api CLI command to use .build directory (qmk#16441)

* Remove `send_unicode_hex_string()` (qmk#16518)

* Change data driven "str" type to represent a quoted string literal (qmk#16516)

* Change data driven "str" type to represent a quoted string literal

* Update docs

* Map data driven `DESCRIPTION` as string literal (qmk#16523)

* update bootloader

* Revert "Merge pull request #2 from qmk/develop"

This reverts commit 9c76065, reversing
changes made to 240745d.

* Revert "update bootloader"

This reverts commit 240745d.

* fix rules.mk

* change PROGRAM_CMD

Co-authored-by: codetector <[email protected]>
Co-authored-by: Fagl4 <[email protected]>
Co-authored-by: Jakob Gillich <[email protected]>
Co-authored-by: tech2077 <[email protected]>
Co-authored-by: jcdeA <[email protected]>
Co-authored-by: Thomaz Moura <[email protected]>
Co-authored-by: Darkhan <[email protected]>
Co-authored-by: Paco <[email protected]>
Co-authored-by: jmarmstrong1207 <[email protected]>
Co-authored-by: 1Conan <[email protected]>
Co-authored-by: Tomasz bla Fortuna <[email protected]>
Co-authored-by: Tomasz bla Fortuna <[email protected]>
Co-authored-by: Nick Brassel <[email protected]>
Co-authored-by: Joel Challis <[email protected]>
Co-authored-by: QMK Bot <[email protected]>
Co-authored-by: Stefan Kerkmann <[email protected]>
Co-authored-by: Ryan <[email protected]>
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.

2 participants