diff options
| author | Luiz Ribeiro <luizribeiro@gmail.com> | 2017-05-28 12:53:13 -0400 |
|---|---|---|
| committer | Luiz Ribeiro <luizribeiro@gmail.com> | 2017-06-11 12:30:48 -0400 |
| commit | 964d7060e1176d487a1f9dfe9bb76b491983748d (patch) | |
| tree | 657fbf9f998c0c858391980457790e8c4e681d40 | |
| parent | 6037cede2ce66dd8ce4df82d6d9a347c1de3110a (diff) | |
| download | qmk_firmware-964d7060e1176d487a1f9dfe9bb76b491983748d.tar.gz qmk_firmware-964d7060e1176d487a1f9dfe9bb76b491983748d.zip | |
Simplified ps2avrGB rgblight_set logic a bit
| -rw-r--r-- | keyboards/ps2avrGB/ps2avrGB.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/keyboards/ps2avrGB/ps2avrGB.c b/keyboards/ps2avrGB/ps2avrGB.c index 89e437786..7ff899854 100644 --- a/keyboards/ps2avrGB/ps2avrGB.c +++ b/keyboards/ps2avrGB/ps2avrGB.c | |||
| @@ -27,21 +27,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 27 | extern rgblight_config_t rgblight_config; | 27 | extern rgblight_config_t rgblight_config; |
| 28 | 28 | ||
| 29 | void rgblight_set(void) { | 29 | void rgblight_set(void) { |
| 30 | uint8_t data[3 * RGBLED_NUM]; | 30 | if (!rgblight_config.enable) { |
| 31 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | 31 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { |
| 32 | if (rgblight_config.enable) { | 32 | led[i].r = 0; |
| 33 | data[3 * i] = led[i].g; | 33 | led[i].g = 0; |
| 34 | data[3 * i + 1] = led[i].r; | 34 | led[i].b = 0; |
| 35 | data[3 * i + 2] = led[i].b; | ||
| 36 | } else { | ||
| 37 | data[3 * i] = 0; | ||
| 38 | data[3 * i + 1] = 0; | ||
| 39 | data[3 * i + 2] = 0; | ||
| 40 | } | 35 | } |
| 41 | } | 36 | } |
| 42 | 37 | ||
| 43 | i2c_init(); | 38 | i2c_init(); |
| 44 | i2c_send(0xb0, data, 48); | 39 | i2c_send(0xb0, (uint8_t*)led, 48); |
| 45 | } | 40 | } |
| 46 | 41 | ||
| 47 | __attribute__ ((weak)) | 42 | __attribute__ ((weak)) |
