Commit Graph

116 Commits (de8fada3a3635f0fc6f1509ea2c0ac53ee880cf5)

Author SHA1 Message Date
Matthes W 6c7450dad7
Add function to allow repeated blinking of one layer (#12237)
* Implement function rgblight_blink_layer_repeat to allow repeated blinking of one layer at a time

* Update doc

* Rework rgblight blinking according to requested change

* optimize storage
2021-05-16 20:59:02 -04:00
Takeshi ISHII b664db3cf3
Removed unused RGBLED_TIMER_TOP and F_CPU macros from quantum/rgblight.[ch] (#12233) 2021-03-25 23:05:38 +11:00
Ryan 53b96f685d
RGBLight: Allow configurable default settings (#11912)
* RGBLight: Allow configurable default settings

* Docs
2021-02-16 10:51:28 -05:00
Nick Brassel d65db68f9f Merge remote-tracking branch 'upstream/master' into develop 2021-01-28 10:52:59 +11:00
Joshua Diamond bad9592a18
Add rgblight_reload_from_eeprom() (#11411)
* Add rgblight_reset_from_eeprom()

* reset->reload
2021-01-28 04:42:03 +11:00
Nick Brassel 31c57aab35 `qmk cformat` 2021-01-17 10:19:56 -08:00
QMK Bot 6f9db2b48e Merge remote-tracking branch 'origin/master' into develop 2021-01-11 08:07:48 +00:00
Joshua Diamond 4d96b85b6f
Lighting Layers should be disabled when suspended (#11442)
* Lighting Layers should be disabled when suspended

* bugfixes
2021-01-11 00:07:09 -08:00
Joshua Diamond 6e8adeeaac
Refine twinkle to be smoother (use breathing curve) (#11350)
* Refine twinkle to be smoother (use breathing curve)

* tune more for firmware size

* fix bug when v=255

~ drashna approved ~
2021-01-10 23:04:42 -08:00
Nick Brassel 271c0cf136 Merge remote-tracking branch 'upstream/master' into develop 2021-01-03 15:26:43 +11:00
Joshua Diamond b3de903a3d
Fix broken Lighting Layers when RGBLIGHT_MAX_LAYERS > 16 (#11406)
* fix incorrect bit math when RGBLIGHT_MAX_LAYERS > 16

* with 1UL cast is not needed

* ...but just casting works and is even more efficient

* cformat
2021-01-02 13:42:48 -08:00
QMK Bot 11ee2736bd Merge remote-tracking branch 'origin/master' into develop 2020-12-12 18:19:43 +00:00
Takeshi ISHII 10e4487ba3
Fix incorrect search order for `rgblight_breathe_table.h` that `rgblight.c` includes. (#11192)
When `rgblight.c` includes `rgblight_breathe_table.h`, the search order should be as follows.

* `keyboards/KEYBOARD/keymaps/USER/rgblight_breathe_table.h`
* `users/USER/rgblight_breathe_table.h`
* `quantum/rgblight_breathe_table.h`

However, the current implementation was wrong, so I fixed it.
2020-12-13 03:19:15 +09:00
QMK Bot fdfcce57e1 Merge remote-tracking branch 'origin/master' into develop 2020-12-11 02:46:19 +00:00
Ryan 501f2fdef1
Normalise include statements in core code (#11153)
* Normalise include statements in core code

* Missed one
2020-12-11 13:45:24 +11:00
XScorpion2 a8d0ec0749
[Split] Sync Timer feature (#10997)
A timer that is kept in sync between the halves of a split keyboard
2020-12-01 10:04:42 -08:00
James Young c66df16644
2020 November 28 Breaking Changes Update (#11053)
* Branch point for 2020 November 28 Breaking Change                                                

* Remove matrix_col_t to allow MATRIX_ROWS > 32 (#10183)                                           

* Add support for soft serial to ATmega32U2 (#10204)                                               

* Change MIDI velocity implementation to allow direct control of velocity value (#9940)            

* Add ability to build a subset of all keyboards based on platform.                                

* Actually use eeprom_driver_init().                                                               

* Make bootloader_jump weak for ChibiOS. (#10417)                                                  

* Joystick 16-bit support (#10439)                                                                 

* Per-encoder resolutions (#10259)                                                                 

* Share button state from mousekey to pointing_device (#10179)                                     

* Add hotfix for chibios keyboards not wake (#10088)                                               

* Add advanced/efficient RGB Matrix Indicators (#8564)                                             

* Naming change.                                                                                   

* Support for STM32 GPIOF,G,H,I,J,K (#10206)                                                       

* Add milc as a dependency and remove the installed milc (#10563)                                  

* ChibiOS upgrade: early init conversions (#10214)                                                 

* ChibiOS upgrade: configuration file migrator (#9952)                                             

* Haptic and solenoid cleanup (#9700)                                                              

* XD75 cleanup (#10524)                                                                            

* OLED display update interval support (#10388)                                                    

* Add definition based on currently-selected serial driver. (#10716)                               

* New feature: Retro Tapping per key (#10622)                                                      

* Allow for modification of output RGB values when using rgblight/rgb_matrix. (#10638)             

* Add housekeeping task callbacks so that keyboards/keymaps are capable of executing code for each main loop iteration. (#10530)

* Rescale both ChibiOS and AVR backlighting.                                                       

* Reduce Helix keyboard build variation (#8669)                                                    

* Minor change to behavior allowing display updates to continue between task ticks (#10750)        

* Some GPIO manipulations in matrix.c change to atomic. (#10491)                                   

* qmk cformat (#10767)                                                                             

* [Keyboard] Update the Speedo firmware for v3.0 (#10657)                                          

* Maartenwut/Maarten namechange to evyd13/Evy (#10274)                                             

* [quantum] combine repeated lines of code (#10837)                                                

* Add step sequencer feature (#9703)                                                               

* aeboards/ext65 refactor (#10820)                                                                 

* Refactor xelus/dawn60 for Rev2 later (#10584)                                                    

* add DEBUG_MATRIX_SCAN_RATE_ENABLE to common_features.mk (#10824)                                 

* [Core] Added `add_oneshot_mods` & `del_oneshot_mods` (#10549)                                    

* update chibios os usb for the otg driver (#8893)                                                 

* Remove HD44780 References, Part 4 (#10735)                                                       

* [Keyboard] Add Valor FRL TKL (+refactor) (#10512)                                                

* Fix cursor position bug in oled_write_raw functions (#10800)                                     

* Fixup version.h writing when using SKIP_VERSION=yes (#10972)                                     

* Allow for certain code in the codebase assuming length of string. (#10974)                       

* Add AT90USB support for serial.c (#10706)                                                        

* Auto shift: support repeats and early registration (#9826)                                       

* Rename ledmatrix.h to match .c file (#7949)                                                      

* Split RGB_MATRIX_ENABLE into _ENABLE and _DRIVER (#10231)                                        

* Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER (#10840)                                        

* Merge point for 2020 Nov 28 Breaking Change
2020-11-28 12:02:18 -08:00
Ryan c16ee22784
`setrgb()`: Use arrow operator (#10451) 2020-09-26 19:42:40 +01:00
QMK Bot a3db72df72 format code according to conventions [skip ci] 2020-08-29 22:57:48 +00:00
Max Rumpf 4b74f985ec Tweak the Christmas animation effect to be less harsh on the eyes (#7648)
* Tweak the Christmas animation effect to be less harsh on the eyes

* Further improve the tweaked Christmas animation code

- Use constants where it makes sense
- Instead of complicated math, use a static variable to keep track if it's animating from or to red
- Don't use pow (but a simple macro instead)
- Using floating point math is necessary for the fraction in the cubic bezier function to work

* Update docs for the tweaked Christmas animation effect

* Further improve memory usage

- Don't use floats, but 32 bit ints instead (where needed)
- Replace limits.h with constant

* Fix typo
2020-08-29 14:30:02 -07:00
Drashna Jaelre b338a4d886
Add noeeprom speed function for RGBLIGHT (#9706)
* [Docs] Add Speed functions to RGB Light docs

* Add noeeprom functions for speed

* Fix wording in doc

Co-authored-by: Ryan <fauxpark@gmail.com>

Co-authored-by: Ryan <fauxpark@gmail.com>
2020-08-25 19:08:09 +10:00
Joshua Diamond 563d5919b3
Fix layer mask size for RGBLIGHT_LAYER_BLINK (#9260) 2020-06-01 17:12:08 -07:00
Joshua Diamond e2e287ec5f
Option to allow lighting layers when RGB Lighting is off (#9051) 2020-06-01 11:02:28 +02:00
QMK Bot 010c5b12bd format code according to conventions [skip ci] 2020-05-18 13:42:23 +00:00
Drashna Jaelre d0e0202b27
Add query functions for RGB Light and RGB Matrix (#8960)
* Add additional query functions for RGBLIGHT

* Add additional query functions for RGB Matrix

* Change names of enable check functions

* Fix macro for rgb matrix takeover of rgblight functions

* Add documentation for rgb_matrix_get_hsv()

* Add *_get_hsv function to rgblight
2020-05-18 06:05:35 -07:00
Joshua Diamond a8a8bf0ff3
Allow expanding from 8 to 32 RGB Lighting Layers (#8941)
* Allow 16 lighting layers

* Require #define RGBLIGHT_LAYERS_16 to enable 16 layers

* Override RGBLIGHT_MAX_LAYERS to set maximum number of lighting layers

* Enforce lower bound on RGBLIGHT_MAX_LAYERS

Co-Authored-By: Takeshi ISHII <2170248+mtei@users.noreply.github.com>

* Fix an error in the check for valid RGBLIGHT_MAX_LAYERS

* Don't use bitfield / PACKED, as it causes bloat

* Update documentation re: up to 32 lighting layers

* Run cformat

* Add note about increasing FW size in docs/config_options.md

Co-authored-by: Drashna Jaelre <drashna@live.com>

* Remove no-longer-valid comment

* Add doc note that split sync will be slower

Co-authored-by: Takeshi ISHII <2170248+mtei@users.noreply.github.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
2020-05-13 21:39:05 +01:00
QMK Bot e7860d673b format code according to conventions [skip ci] 2020-05-09 09:31:49 +00:00
Joshua Diamond 2fe7e221ec
New RGB Lighting effect: Twinkle (#8887)
* Add twinkle RGB Lighting effect

* 2nd twinkle algo - double-buffering

* Further refinement: Per-LED twinkle

* Add documentation for Twinkle RBG Lighting mode

* Bias twinkle saturation closer to the set value

* Fix whitespace
2020-05-09 01:56:16 -07:00
Joshua Diamond e0f548085c
Add ability to blink lighting layer for a specified duration (#8760)
* Implement momentarily blink of lighting layers

* Refactor spidey3 userspace to use rgb layer blink

* Remove un-necessary line from example in documentation

* Revert "Refactor spidey3 userspace to use rgb layer blink"

This reverts commit 831649bb680c41c6d663ae6fa86d13f4f8bebdd8.

* Adds a missing bit of documentation about lighting layer blink

* Update docs/feature_rgblight.md per suggestions

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_rgblight.md per suggestions

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_rgblight.md per suggestions

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* cformat, as suggested

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
2020-05-09 01:38:33 -07:00
QMK Bot 812d80efbd format code according to conventions [skip ci] 2020-04-29 08:57:41 +00:00
Drashna Jaelre 86c4c4e91d
Convert clipping variables in rgblight.c to a structure (#7720) 2020-04-29 10:22:28 +02:00
QMK Bot 1aa40dde46 format code according to conventions [skip ci] 2020-03-10 20:24:13 +00:00
Nathan Gray 2ffb08843b
Feature: RGBLight layers (#7768)
* New feature: RGBLIGHT_LAYERS

This feature allows users to define multiple independent layers of lighting
that can be toggled on and off individually, making it easy to use your
RGB lighting to indicate things like active keyboard layer & modifier state.

* Demonstrate built in functions for layer state checking

Also link the video in the docs.

* Follow existing pattern for setting rgblight_status flags

* Eliminate rgblight_is_static_mode since it's not needed

Just check to see if the timer is enabled directly.
2020-03-10 12:50:01 -07:00
Takeshi ISHII dbbab40981
Refactor rgblight_reconfig.h (#7773)
* Moved contents of rgblight_reconfig.h to rgblight_post_config.h.

In #3582, rgblight_reconfig.h had to be newly created. Now, the build system of qmk_firmware has a post_cofig feature, so that what was done in rgblight_reconfig.h can now be realized in rgblight_post_config.h.

**This commit does not change the build result.**

Testing script
```shell
  # build on master
  git checkout master
  echo master > /tmp/master_md5.txt

  # RGBLIGHT_ENABLE = no
  make HELIX=verbose helix/rev2:default:clean
  make HELIX=verbose helix/rev2:default
  md5 helix_rev2_default.hex >> /tmp/master_md5.txt

  # RGBLIGHT_ENABLE = yes, with animations
  make HELIX=verbose helix/rev2/back:default:clean
  make HELIX=verbose helix/rev2/back:default
  md5 helix_rev2_back_default.hex >> /tmp/master_md5.txt

  # RGBLIGHT_ENABLE = yes, without animations
  make HELIX=verbose,no_ani helix/rev2/back:default:clean
  make HELIX=verbose,no_ani helix/rev2/back:default
  md5 helix_rev2_back_default.hex >> /tmp/master_md5.txt

  # build on refactor_rgblight_reconfig.h
  git checkout refactor_rgblight_reconfig.h
  echo refactor_rgblight_reconfig.h > /tmp/branch_md5.txt

  # RGBLIGHT_ENABLE = no
  make HELIX=verbose helix/rev2:default:clean
  make HELIX=verbose helix/rev2:default
  md5 helix_rev2_default.hex >> /tmp/branch_md5.txt

  # RGBLIGHT_ENABLE = yes, with animations
  make HELIX=verbose helix/rev2/back:default:clean
  make HELIX=verbose helix/rev2/back:default
  md5 helix_rev2_back_default.hex >> /tmp/branch_md5.txt

  # RGBLIGHT_ENABLE = yes, without animations
  make HELIX=verbose,no_ani helix/rev2/back:default:clean
  make HELIX=verbose,no_ani helix/rev2/back:default
  md5 helix_rev2_back_default.hex >> /tmp/branch_md5.txt

  diff -u /tmp/master_md5.txt /tmp/branch_md5.txt
```

Test result:
```
--- /tmp/master_md5.txt 2020-01-03 15:42:22.000000000 +0900
+++ /tmp/branch_md5.txt 2020-01-03 15:42:42.000000000 +0900
@@ -1,4 +1,4 @@
-master
+refactor_rgblight_reconfig.h
 MD5 (helix_rev2_default.hex) = f360032edd522448366d471d8f4f8181
 MD5 (helix_rev2_back_default.hex) = 0c663acc6cccc44476b3b969ad22a48f
 MD5 (helix_rev2_back_default.hex) = e66b1195ff6d38e6e22c975b8ae42fd3
```

* Expressions that are too long are difficult to read, so wrap them.

* Edit the expression again

* remove `defined(RGBLIGHT_ANIMATIONS)` in `tmk_core/common/*/suspend.c`, `tmk_core/protocol/*/main.c`

move contents of rgblight_reconfig.h to rgblight.h.

The following changes were made to rgblight.h.

```diff
+#ifdef RGBLIGHT_USE_TIMER
 void rgblight_task(void);

 void rgblight_timer_init(void);
 void rgblight_timer_enable(void);
 void rgblight_timer_disable(void);
 void rgblight_timer_toggle(void);
+#else
+#define rgblight_task()
+#define rgblight_timer_init()
+#define rgblight_timer_enable()
+#define rgblight_timer_disable()
+#define rgblight_timer_toggle()
+#endif
```

The following changes were made to tmk_core/common/avr/suspend.c, tmk_core/common/chibios/suspend.c, tmk_core/protocol/chibios/main.c, tmk_core/protocol/lufa/lufa.c, tmk_core/protocol/vusb/main.c.

```diff
-#    ifdef RGBLIGHT_ANIMATIONS
     rgblight_timer_enable();
-#    endif
```
```diff
-#if defined(RGBLIGHT_ANIMATIONS) && defined(RGBLIGHT_ENABLE)
+#if defined(RGBLIGHT_ENABLE)
         rgblight_task();
 #endif
```

* remove 'defined(RGBLIGHT_ANIMATIONS)' in tmk_core/common/keyboard.c

Co-authored-by: Joel Challis <git@zvecr.com>
2020-03-10 01:46:03 -07:00
Nick Brassel d13ada1162 Add customisable EEPROM driver selection (#7274)
- uprintf -> dprintf
- Fix atsam "vendor" eeprom.
- Bump Kinetis K20x to 64 bytes, too.
- Rollback Kinetis to 32 bytes as partitioning can only be done once. Add warning about changing the value.
- Change RAM-backed "fake" EEPROM implementations to match eeconfig's current usage.
- Add 24LC128 by request.
2020-01-24 12:45:58 +11:00
QMK Bot e3d59a72f9 format code according to conventions [skip ci] 2020-01-20 18:48:28 +00:00
Wilba 484a9b12bc Add VIA support for QMK backlight, QMK RGBLight (#7911)
* Add VIA support for QMK backlight, QMK RGBLight

* clang-format changes
2020-01-20 10:18:25 -08:00
Joel Challis 667045b492
Run clang-format manually to fix recently changed files (#7934)
* Run clang-format manually to fix recently changed files

* Run clang-format manually to fix recently changed files - revert template files

* Run clang-format manually to fix recently changed files - format off for ascii_to_keycode_lut
2020-01-19 16:30:34 +00:00
Drashna Jaelre 7ba6456c0b Use White channel on RGBW LEDs (#7678)
* Use White channel on RGBW LEDs

Co-authored-by: kwerdenker <sebastian.spindler@gmail.com>

* Manually apply white channel to array

* Move where convert_rgb_to_rgbw is called

* Fix type for rgbw led struct

* Add changes to Ergodox EZ

can revert if deemed necessary

* Revert "Add changes to Ergodox EZ"

This reverts commit aa44db198d40d758ca10470eb94615513592d1dd.

* Revert "Fix type for rgbw led struct"

This reverts commit c5c744cba040201cc0d124400773cf13f8a2cf22.

* Revert "Move where convert_rgb_to_rgbw is called"

This reverts commit cd7f17caf6dd30731c54b3be54490fe4519444f9.

* Revert changes and fix up functions

* Enable white channel for Ergodox EZ as well

* Only run conversion of rgblight is enabled

Co-authored-by: kwerdenker <sebastian.spindler@gmail.com>
2019-12-31 16:33:49 +00:00
zvecr a91c0c4765 Run clang-format manually to fix recently changed files 2019-11-17 08:25:58 -08:00
Joel Challis f48986dda2
Remove force of debug on within rgblight - causes lockups waiting for hid_listen (#7330) 2019-11-11 21:06:14 +00:00
Drashna Jaelre 60e4921378 Unify RGB and RGBW commands (#7297)
* Fix unicode in comments

Co-Authored-By: fauxpark <fauxpark@gmail.com>

* Remove separate RGBW implementation for a unified function

* Set White to 0 in RGBW LEDs

This is just to get this working, later, proper brightness can be handled elsewhere.

* Use us instead of nanoseconds(?) since it renders correctly on web

* Remove RGBW function from arm/ws2812.h

* Remove RGBW function from arm/ws2812.c

* Formatting changes

* Add doc info
2019-11-09 15:51:39 +00:00
theVDude 5a3aefed8d Fix small hiccup in snake animation (#6858) 2019-10-15 23:13:13 +01:00
skullY b624f32f94 clang-format changes 2019-08-30 15:01:52 -07:00
Konstantin Đorđević e040028f1b Change xprintf() calls in rgblight.c to dprintf() (#6363) 2019-07-19 08:47:04 -07:00
Takeshi ISHII 670a9b7f83 Add effect range to rgblight.c (#5856)
* add rgblight_set_effect_range()

* implement effect range

* Arrange the order of function list in rgblight.h .

* update docs/feature_rgblight.md

* fix RGBLIGHT_RAINBOW_SWIRL_RANGE default value

* add example code about Utility Functions

* add example code about direct operation functions

* When RGBLIGHT_SPLIT is defined, the following function has no meaning and is invalidated.

 * rgblight_setrgb_master(r, g, b)
 * rgblight_setrgb_slave(r, g, b)
 * rgblight_sethsv_master(h, s, v)
 * rgblight_sethsv_slave(h, s, v)

* add temporary test code for rgblight_set_effect_range

* fix rgblight_effect_knight() bug

* Test End. Revert "add temporary test code for rgblight_set_effect_range"

This reverts commit 5680cddd012d68b2db75a532862a7fef250f8973.
2019-05-15 21:11:28 -07:00
Takeshi ISHII 3da8d46a07 If RGBLIGHT_EFFECT_BREATHE_CENTER is undefined, use fixed breathe table instead of exp() and sin() (#5484)
* If RGBLIGHT_EFFECT_BREATHE_CENTER is undefined, use fixed breathe table instead of exp() and sin()

* Change rgblight breathing table size to be easily selectable.

add RGBLIGHT_BREATHE_TABLE_SIZE macro for customize breathing effect.
2019-05-02 07:59:29 -07:00
XScorpion2 22ba36a4d8 rgblight 255 hue (#5547) 2019-05-01 08:02:02 -07:00
mtei 9f8c8c53a5 add RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; to rgblight_update_dword() 2019-04-24 12:52:15 -07:00
mtei 5312131d35 add RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; to eeconfig_update_rgblight_default() 2019-04-24 12:52:15 -07:00