Skip to content

Commit

Permalink
Moved contents of rgblight_reconfig.h to rgblight_post_config.h.
Browse files Browse the repository at this point in the history
In qmk#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
```
  • Loading branch information
mtei committed Jan 20, 2020
1 parent 61dbb92 commit e617fd6
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 35 deletions.
2 changes: 0 additions & 2 deletions quantum/rgblight.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#ifndef RGBLIGHT_H
#define RGBLIGHT_H

#include "rgblight_reconfig.h"

/***** rgblight_mode(mode)/rgblight_mode_noeeprom(mode) ****
old mode number (before 0.6.117) to new mode name table
Expand Down
25 changes: 25 additions & 0 deletions quantum/rgblight_post_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,28 @@
// it is considered that RGBLIGHT_SPLIT is defined implicitly.
# define RGBLIGHT_SPLIT
#endif

#ifdef RGBLIGHT_ANIMATIONS
// for backward compatibility
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
# define RGBLIGHT_EFFECT_CHRISTMAS
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
# define RGBLIGHT_EFFECT_RGB_TEST
# define RGBLIGHT_EFFECT_ALTERNATING
#endif

#ifdef RGBLIGHT_STATIC_PATTERNS
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
#endif

// check dynamic animation effects chose ?
#if defined(RGBLIGHT_EFFECT_BREATHING) || defined(RGBLIGHT_EFFECT_RAINBOW_MOOD) || defined(RGBLIGHT_EFFECT_RAINBOW_SWIRL) || defined(RGBLIGHT_EFFECT_SNAKE) || defined(RGBLIGHT_EFFECT_KNIGHT) || defined(RGBLIGHT_EFFECT_CHRISTMAS) || defined(RGBLIGHT_EFFECT_RGB_TEST) || defined(RGBLIGHT_EFFECT_ALTERNATING)
# define RGBLIGHT_USE_TIMER
# ifndef RGBLIGHT_ANIMATIONS
# define RGBLIGHT_ANIMATIONS // for backward compatibility
# endif
#endif
29 changes: 0 additions & 29 deletions quantum/rgblight_reconfig.h

This file was deleted.

1 change: 0 additions & 1 deletion tmk_core/common/avr/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "timer.h"
#include "led.h"
#include "host.h"
#include "rgblight_reconfig.h"

#ifdef PROTOCOL_LUFA
# include "lufa.h"
Expand Down
1 change: 0 additions & 1 deletion tmk_core/protocol/chibios/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "sendchar.h"
#include "debug.h"
#include "printf.h"
#include "rgblight_reconfig.h"

#if (defined(RGB_MIDI) || defined(RGBLIGHT_ANIMATIONS)) && defined(RGBLIGHT_ENABLE)
# include "rgblight.h"
Expand Down
1 change: 0 additions & 1 deletion tmk_core/protocol/lufa/lufa.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#include "quantum.h"
#include <util/atomic.h>
#include "outputselect.h"
#include "rgblight_reconfig.h"

#ifdef NKRO_ENABLE
# include "keycode_config.h"
Expand Down
1 change: 0 additions & 1 deletion tmk_core/protocol/vusb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "timer.h"
#include "uart.h"
#include "debug.h"
#include "rgblight_reconfig.h"

#if (defined(RGB_MIDI) || defined(RGBLIGHT_ANIMATIONS)) && defined(RGBLIGHT_ENABLE)
# include "rgblight.h"
Expand Down

0 comments on commit e617fd6

Please sign in to comment.