qmk_firmware/tmk_core/common
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
..
arm_atsam format code according to conventions [skip ci] 2020-01-24 02:15:29 +00:00
avr Refactor rgblight_reconfig.h (#7773) 2020-03-10 01:46:03 -07:00
chibios Refactor rgblight_reconfig.h (#7773) 2020-03-10 01:46:03 -07:00
test Add customisable EEPROM driver selection (#7274) 2020-01-24 12:45:58 +11:00
action.c 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
action.h Fix bug in `do_code16()` (#6935) 2019-10-16 00:02:09 +01:00
action_code.h 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
action_layer.c Fix LAYER_STATE_8BIT compile issues (#7304) 2019-11-08 18:23:26 -08:00
action_layer.h Fix LAYER_STATE_8BIT compile issues (#7304) 2019-11-08 18:23:26 -08:00
action_macro.c
action_macro.h
action_tapping.c format code according to conventions [skip ci] 2020-02-25 18:57:18 +00:00
action_tapping.h
action_util.c
action_util.h
bootloader.h
bootmagic.c
bootmagic.h
command.c 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
command.h
debug.c
debug.h
eeconfig.c Add customisable EEPROM driver selection (#7274) 2020-01-24 12:45:58 +11:00
eeconfig.h VIA Configurator Refactor (#7268) 2020-01-03 12:52:00 -08:00
eeprom.h Add customisable EEPROM driver selection (#7274) 2020-01-24 12:45:58 +11:00
host.c Run clang-format manually to fix recently changed files 2019-11-17 08:25:58 -08:00
host.h New and improved lock LED callbacks (#7215) 2019-11-06 00:42:16 +00:00
host_driver.h
keyboard.c Refactor rgblight_reconfig.h (#7773) 2020-03-10 01:46:03 -07:00
keyboard.h
keycode.h Add 4-character aliases for sendstring keycodes (#7409) 2019-11-22 14:11:28 +11:00
led.h Run clang-format manually to fix recently changed files 2019-11-17 08:25:58 -08:00
magic.c
magic.h
matrix.h Allow 30us matrix delay to be keyboard/user overridable (#8216) 2020-02-21 14:49:33 +11:00
mousekey.c
mousekey.h
nodebug.h
print.c
print.h Remove mbed files (#7605) 2019-12-11 11:36:00 -08:00
progmem.h Clean up includes for glcdfont headers (#7745) 2020-03-01 17:56:50 +11:00
raw_hid.h
report.c
report.h Use function for KEYCODE2 routines instead of macro. (#8101) 2020-02-07 12:53:43 +11:00
sendchar.h
sendchar_null.c
sendchar_uart.c
sleep_led.h
suspend.h
timer.h 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
uart.c format code according to conventions [skip ci] 2020-03-06 13:28:11 +00:00
uart.h
util.c
util.h
virtser.h
wait.h Remove mbed files (#7605) 2019-12-11 11:36:00 -08:00