diff options
| author | fauxpark <fauxpark@gmail.com> | 2019-11-05 11:05:03 +1100 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-11-04 16:05:03 -0800 |
| commit | efa28d0f5cca55b0dfecaddd0860ec3dfeab8bb0 (patch) | |
| tree | aab048a027771fa8ab55b535bce64e101e861680 | |
| parent | 0a9a69394e132c3d00eddffd2e345f48113e56c4 (diff) | |
| download | qmk_firmware-efa28d0f5cca55b0dfecaddd0860ec3dfeab8bb0.tar.gz qmk_firmware-efa28d0f5cca55b0dfecaddd0860ec3dfeab8bb0.zip | |
Convert some PS2AVRGB boards to I2C WS2812 driver (#7241)
* Convert some PS2AVRGB boards to I2C WS2812 driver
* Fix Travis failure for bface
40 files changed, 122 insertions, 1157 deletions
diff --git a/keyboards/ares/ares.c b/keyboards/ares/ares.c index 85c7435ed..07276491c 100644 --- a/keyboards/ares/ares.c +++ b/keyboards/ares/ares.c | |||
| @@ -17,50 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 17 | 17 | ||
| 18 | #include "ares.h" | 18 | #include "ares.h" |
| 19 | 19 | ||
| 20 | #ifdef RGBLIGHT_ENABLE | ||
| 21 | |||
| 22 | #include <string.h> | ||
| 23 | #include "i2c_master.h" | ||
| 24 | #include "rgblight.h" | ||
| 25 | |||
| 26 | extern rgblight_config_t rgblight_config; | ||
| 27 | |||
| 28 | void matrix_init_kb(void) { | ||
| 29 | i2c_init(); | ||
| 30 | // call user level keymaps, if any | ||
| 31 | matrix_init_user(); | ||
| 32 | } | ||
| 33 | |||
| 34 | // custom RGB driver | ||
| 35 | void rgblight_set(void) { | ||
| 36 | if (!rgblight_config.enable) { | ||
| 37 | memset(led, 0, 3 * RGBLED_NUM); | ||
| 38 | } | ||
| 39 | |||
| 40 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 41 | } | ||
| 42 | |||
| 43 | bool rgb_init = false; | ||
| 44 | |||
| 45 | void matrix_scan_kb(void) { | ||
| 46 | // if LEDs were previously on before poweroff, turn them back on | ||
| 47 | if (rgb_init == false && rgblight_config.enable) { | ||
| 48 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 49 | rgb_init = true; | ||
| 50 | } | ||
| 51 | |||
| 52 | rgblight_task(); | ||
| 53 | matrix_scan_user(); | ||
| 54 | } | ||
| 55 | |||
| 56 | #endif | ||
| 57 | |||
| 58 | #ifdef BACKLIGHT_ENABLE | 20 | #ifdef BACKLIGHT_ENABLE |
| 59 | void backlight_init_ports(void) { | 21 | void backlight_init_ports(void) { |
| 60 | setPinOutput(D0); | 22 | setPinOutput(D0); |
| 61 | setPinOutput(D1); | 23 | setPinOutput(D1); |
| 62 | setPinOutput(D4); | 24 | setPinOutput(D4); |
| 63 | setPinOutput(D6); | 25 | setPinOutput(D6); |
| 64 | } | 26 | } |
| 65 | 27 | ||
| 66 | void backlight_set(uint8_t level) { | 28 | void backlight_set(uint8_t level) { |
| @@ -79,29 +41,3 @@ void backlight_set(uint8_t level) { | |||
| 79 | } | 41 | } |
| 80 | } | 42 | } |
| 81 | #endif | 43 | #endif |
| 82 | |||
| 83 | // Optional override functions below. | ||
| 84 | // You can leave any or all of these undefined. | ||
| 85 | // These are only required if you want to perform custom actions. | ||
| 86 | |||
| 87 | /* | ||
| 88 | void matrix_init_kb(void) { | ||
| 89 | // put your keyboard start-up code here | ||
| 90 | // runs once when the firmware starts up | ||
| 91 | matrix_init_user(); | ||
| 92 | } | ||
| 93 | void matrix_scan_kb(void) { | ||
| 94 | // put your looping keyboard code here | ||
| 95 | // runs every cycle (a lot) | ||
| 96 | matrix_scan_user(); | ||
| 97 | } | ||
| 98 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 99 | // put your per-action keyboard code here | ||
| 100 | // runs for every action, just before processing by the firmware | ||
| 101 | return process_record_user(keycode, record); | ||
| 102 | } | ||
| 103 | void led_set_kb(uint8_t usb_led) { | ||
| 104 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | ||
| 105 | led_set_user(usb_led); | ||
| 106 | } | ||
| 107 | */ \ No newline at end of file | ||
diff --git a/keyboards/ares/rules.mk b/keyboards/ares/rules.mk index 3ac90cf97..58d36bc67 100644 --- a/keyboards/ares/rules.mk +++ b/keyboards/ares/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = no | 20 | BACKLIGHT_ENABLE = no |
| 36 | RGBLIGHT_ENABLE = no | 21 | RGBLIGHT_ENABLE = no |
| 37 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | |||
| 41 | SRC += i2c_master.c | ||
diff --git a/keyboards/donutcables/budget96/budget96.c b/keyboards/donutcables/budget96/budget96.c index 2fc826f09..e9125a3e6 100644 --- a/keyboards/donutcables/budget96/budget96.c +++ b/keyboards/donutcables/budget96/budget96.c | |||
| @@ -13,61 +13,8 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "budget96.h" | ||
| 17 | |||
| 18 | #ifdef BACKLIGHT_ENABLE | ||
| 19 | #include "backlight.h" | ||
| 20 | #endif | ||
| 21 | #ifdef RGBLIGHT_ENABLE | ||
| 22 | #include "rgblight.h" | ||
| 23 | #endif | ||
| 24 | |||
| 25 | #include <avr/pgmspace.h> | ||
| 26 | |||
| 27 | #include "action_layer.h" | ||
| 28 | #include "i2c_master.h" | ||
| 29 | #include "quantum.h" | ||
| 30 | |||
| 31 | __attribute__ ((weak)) | ||
| 32 | void matrix_scan_user(void) { | ||
| 33 | } | ||
| 34 | |||
| 35 | #ifdef RGBLIGHT_ENABLE | ||
| 36 | extern rgblight_config_t rgblight_config; | ||
| 37 | |||
| 38 | void rgblight_set(void) { | ||
| 39 | if (!rgblight_config.enable) { | ||
| 40 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 41 | led[i].r = 0; | ||
| 42 | led[i].g = 0; | ||
| 43 | led[i].b = 0; | ||
| 44 | } | ||
| 45 | } | ||
| 46 | |||
| 47 | i2c_init(); | ||
| 48 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 49 | } | ||
| 50 | #endif | ||
| 51 | |||
| 52 | void matrix_init_kb(void) { | ||
| 53 | #ifdef RGBLIGHT_ENABLE | ||
| 54 | if (rgblight_config.enable) { | ||
| 55 | i2c_init(); | ||
| 56 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 57 | } | ||
| 58 | #endif | ||
| 59 | // call user level keymaps, if any | ||
| 60 | matrix_init_user(); | ||
| 61 | } | ||
| 62 | |||
| 63 | void matrix_scan_kb(void) { | ||
| 64 | #ifdef RGBLIGHT_ENABLE | ||
| 65 | rgblight_task(); | ||
| 66 | #endif | ||
| 67 | matrix_scan_user(); | ||
| 68 | /* Nothing else for now. */ | ||
| 69 | } | ||
| 70 | 16 | ||
| 17 | #include "budget96.h" | ||
| 71 | 18 | ||
| 72 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 73 | // initialize pins D0, D1, D4 and D6 as output | 20 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -76,25 +23,25 @@ void backlight_init_ports(void) { | |||
| 76 | setPinOutput(D4); | 23 | setPinOutput(D4); |
| 77 | setPinOutput(D6); | 24 | setPinOutput(D6); |
| 78 | 25 | ||
| 79 | // turn RGB LEDs on | 26 | // turn backlight LEDs on |
| 80 | writePinHigh(D0); | 27 | writePinHigh(D0); |
| 81 | writePinHigh(D1); | 28 | writePinHigh(D1); |
| 82 | writePinHigh(D4); | 29 | writePinHigh(D4); |
| 83 | writePinHigh(D6); | 30 | writePinHigh(D6); |
| 84 | } | 31 | } |
| 85 | 32 | ||
| 86 | void backlight_set(uint8_t level) { | 33 | void backlight_set(uint8_t level) { |
| 87 | if (level == 0) { | 34 | if (level == 0) { |
| 88 | // turn RGB LEDs off | 35 | // turn backlight LEDs off |
| 89 | writePinLow(D0); | 36 | writePinLow(D0); |
| 90 | writePinLow(D1); | 37 | writePinLow(D1); |
| 91 | writePinLow(D4); | 38 | writePinLow(D4); |
| 92 | writePinLow(D6); | 39 | writePinLow(D6); |
| 93 | } else { | 40 | } else { |
| 94 | // turn RGB LEDs on | 41 | // turn backlight LEDs on |
| 95 | writePinHigh(D0); | 42 | writePinHigh(D0); |
| 96 | writePinHigh(D1); | 43 | writePinHigh(D1); |
| 97 | writePinHigh(D4); | 44 | writePinHigh(D4); |
| 98 | writePinHigh(D6); | 45 | writePinHigh(D6); |
| 99 | } | 46 | } |
| 100 | } | 47 | } |
diff --git a/keyboards/donutcables/budget96/rules.mk b/keyboards/donutcables/budget96/rules.mk index 4f9e0e412..54328d248 100644 --- a/keyboards/donutcables/budget96/rules.mk +++ b/keyboards/donutcables/budget96/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,9 +19,6 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = yes | 20 | BACKLIGHT_ENABLE = yes |
| 36 | RGBLIGHT_ENABLE = yes | 21 | RGBLIGHT_ENABLE = yes |
| 37 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | |||
| 41 | # custom matrix setup | ||
| 42 | SRC = i2c_master.c | ||
diff --git a/keyboards/eve/meteor/meteor.c b/keyboards/eve/meteor/meteor.c index 1bd47ef9e..f5ecbad02 100644 --- a/keyboards/eve/meteor/meteor.c +++ b/keyboards/eve/meteor/meteor.c | |||
| @@ -14,49 +14,7 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include "i2c_master.h" | 17 | #include "meteor.h" |
| 18 | #include "quantum.h" | ||
| 19 | |||
| 20 | #ifdef RGBLIGHT_ENABLE | ||
| 21 | #include "rgblight.h" | ||
| 22 | extern rgblight_config_t rgblight_config; | ||
| 23 | |||
| 24 | void rgblight_set(void) { | ||
| 25 | if (!rgblight_config.enable) { | ||
| 26 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 27 | led[i].r = 0; | ||
| 28 | led[i].g = 0; | ||
| 29 | led[i].b = 0; | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | i2c_init(); | ||
| 34 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 35 | } | ||
| 36 | #endif | ||
| 37 | |||
| 38 | void matrix_init_kb(void) { | ||
| 39 | #ifdef RGBLIGHT_ENABLE | ||
| 40 | if (rgblight_config.enable) { | ||
| 41 | i2c_init(); | ||
| 42 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 43 | } | ||
| 44 | #endif | ||
| 45 | // call user level keymaps, if any | ||
| 46 | matrix_init_user(); | ||
| 47 | } | ||
| 48 | |||
| 49 | void matrix_scan_kb(void) { | ||
| 50 | #ifdef RGBLIGHT_ENABLE | ||
| 51 | rgblight_task(); | ||
| 52 | #endif | ||
| 53 | matrix_scan_user(); | ||
| 54 | /* Nothing else for now. */ | ||
| 55 | } | ||
| 56 | |||
| 57 | __attribute__ ((weak)) | ||
| 58 | void matrix_scan_user(void) { | ||
| 59 | } | ||
| 60 | 18 | ||
| 61 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 62 | // initialize pins D0, D1, D4 and D6 as output | 20 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -73,17 +31,17 @@ void backlight_init_ports(void) { | |||
| 73 | } | 31 | } |
| 74 | 32 | ||
| 75 | void backlight_set(uint8_t level) { | 33 | void backlight_set(uint8_t level) { |
| 76 | if (level == 0) { | 34 | if (level == 0) { |
| 77 | // turn backlight LEDs off | 35 | // turn backlight LEDs off |
| 78 | writePinLow(D0); | 36 | writePinLow(D0); |
| 79 | writePinLow(D1); | 37 | writePinLow(D1); |
| 80 | writePinLow(D4); | 38 | writePinLow(D4); |
| 81 | writePinLow(D6); | 39 | writePinLow(D6); |
| 82 | } else { | 40 | } else { |
| 83 | // turn backlight LEDs on | 41 | // turn backlight LEDs on |
| 84 | writePinHigh(D0); | 42 | writePinHigh(D0); |
| 85 | writePinHigh(D1); | 43 | writePinHigh(D1); |
| 86 | writePinHigh(D4); | 44 | writePinHigh(D4); |
| 87 | writePinHigh(D6); | 45 | writePinHigh(D6); |
| 88 | } | 46 | } |
| 89 | } | 47 | } |
diff --git a/keyboards/eve/meteor/rules.mk b/keyboards/eve/meteor/rules.mk index e43baee5c..e57c21c85 100644 --- a/keyboards/eve/meteor/rules.mk +++ b/keyboards/eve/meteor/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = yes | 20 | BACKLIGHT_ENABLE = yes |
| 36 | RGBLIGHT_ENABLE = no | 21 | RGBLIGHT_ENABLE = no |
| 37 | RGBLIGHT_CUSTOM_DRIVER = no | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | |||
| 41 | QUANTUM_LIB_SRC = i2c_master.c | ||
diff --git a/keyboards/exclusive/e6v2/le_bmc/le_bmc.c b/keyboards/exclusive/e6v2/le_bmc/le_bmc.c index 5f7ef25b2..e3b81c81b 100644 --- a/keyboards/exclusive/e6v2/le_bmc/le_bmc.c +++ b/keyboards/exclusive/e6v2/le_bmc/le_bmc.c | |||
| @@ -13,49 +13,8 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "rgblight.h" | ||
| 17 | #include "i2c_master.h" | ||
| 18 | #include "quantum.h" | ||
| 19 | 16 | ||
| 20 | #ifdef RGBLIGHT_ENABLE | 17 | #include "le_bmc.h" |
| 21 | extern rgblight_config_t rgblight_config; | ||
| 22 | |||
| 23 | void rgblight_set(void) { | ||
| 24 | if (!rgblight_config.enable) { | ||
| 25 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 26 | led[i].r = 0; | ||
| 27 | led[i].g = 0; | ||
| 28 | led[i].b = 0; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | i2c_init(); | ||
| 33 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 34 | } | ||
| 35 | #endif | ||
| 36 | |||
| 37 | void matrix_init_kb(void) { | ||
| 38 | #ifdef RGBLIGHT_ENABLE | ||
| 39 | if (rgblight_config.enable) { | ||
| 40 | i2c_init(); | ||
| 41 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 42 | } | ||
| 43 | #endif | ||
| 44 | // call user level keymaps, if any | ||
| 45 | matrix_init_user(); | ||
| 46 | } | ||
| 47 | |||
| 48 | void matrix_scan_kb(void) { | ||
| 49 | #ifdef RGBLIGHT_ENABLE | ||
| 50 | rgblight_task(); | ||
| 51 | #endif | ||
| 52 | matrix_scan_user(); | ||
| 53 | /* Nothing else for now. */ | ||
| 54 | } | ||
| 55 | |||
| 56 | __attribute__ ((weak)) | ||
| 57 | void matrix_scan_user(void) { | ||
| 58 | } | ||
| 59 | 18 | ||
| 60 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 61 | // initialize pins D0, D1, D4 and D6 as output | 20 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -72,17 +31,17 @@ void backlight_init_ports(void) { | |||
| 72 | } | 31 | } |
| 73 | 32 | ||
| 74 | void backlight_set(uint8_t level) { | 33 | void backlight_set(uint8_t level) { |
| 75 | if (level == 0) { | 34 | if (level == 0) { |
| 76 | // turn backlight LEDs off | 35 | // turn backlight LEDs off |
| 77 | writePinLow(D0); | 36 | writePinLow(D0); |
| 78 | writePinLow(D1); | 37 | writePinLow(D1); |
| 79 | writePinLow(D4); | 38 | writePinLow(D4); |
| 80 | writePinLow(D6); | 39 | writePinLow(D6); |
| 81 | } else { | 40 | } else { |
| 82 | // turn backlight LEDs on | 41 | // turn backlight LEDs on |
| 83 | writePinHigh(D0); | 42 | writePinHigh(D0); |
| 84 | writePinHigh(D1); | 43 | writePinHigh(D1); |
| 85 | writePinHigh(D4); | 44 | writePinHigh(D4); |
| 86 | writePinHigh(D6); | 45 | writePinHigh(D6); |
| 87 | } | 46 | } |
| 88 | } \ No newline at end of file | 47 | } |
diff --git a/keyboards/exclusive/e6v2/le_bmc/rules.mk b/keyboards/exclusive/e6v2/le_bmc/rules.mk index 13a5f1b89..106044ba7 100644 --- a/keyboards/exclusive/e6v2/le_bmc/rules.mk +++ b/keyboards/exclusive/e6v2/le_bmc/rules.mk | |||
| @@ -24,7 +24,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | |||
| 24 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 24 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 25 | NKRO_ENABLE = no # USB Nkey Rollover | 25 | NKRO_ENABLE = no # USB Nkey Rollover |
| 26 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default | 26 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default |
| 27 | RGBLIGHT_CUSTOM_DRIVER = yes | 27 | WS2812_DRIVER = i2c |
| 28 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow | 28 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow |
| 29 | MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) | 29 | MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) |
| 30 | UNICODE_ENABLE = no # Unicode | 30 | UNICODE_ENABLE = no # Unicode |
| @@ -34,4 +34,3 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches | |||
| 34 | HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) | 34 | HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) |
| 35 | 35 | ||
| 36 | OPT_DEFS = -DDEBUG_LEVEL=0 | 36 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 37 | SRC += i2c_master.c | ||
diff --git a/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c b/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c index 5357550ae..97d354653 100644 --- a/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c +++ b/keyboards/exclusive/e6v2/oe_bmc/oe_bmc.c | |||
| @@ -13,57 +13,8 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "oe_bmc.h" | ||
| 17 | #include "rgblight.h" | ||
| 18 | #include "i2c_master.h" | ||
| 19 | |||
| 20 | void matrix_init_kb(void) { | ||
| 21 | // put your keyboard start-up code here | ||
| 22 | // runs once when the firmware starts up | ||
| 23 | |||
| 24 | matrix_init_user(); | ||
| 25 | } | ||
| 26 | |||
| 27 | void matrix_scan_kb(void) { | ||
| 28 | // put your looping keyboard code here | ||
| 29 | // runs every cycle (a lot) | ||
| 30 | |||
| 31 | matrix_scan_user(); | ||
| 32 | } | ||
| 33 | |||
| 34 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 35 | // put your per-action keyboard code here | ||
| 36 | // runs for every action, just before processing by the firmware | ||
| 37 | |||
| 38 | return process_record_user(keycode, record); | ||
| 39 | } | ||
| 40 | |||
| 41 | void led_set_kb(uint8_t usb_led) { | ||
| 42 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | ||
| 43 | 16 | ||
| 44 | led_set_user(usb_led); | 17 | #include "oe_bmc.h" |
| 45 | } | ||
| 46 | |||
| 47 | #ifdef RGBLIGHT_ENABLE | ||
| 48 | extern rgblight_config_t rgblight_config; | ||
| 49 | |||
| 50 | void rgblight_set(void) { | ||
| 51 | if (!rgblight_config.enable) { | ||
| 52 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 53 | led[i].r = 0; | ||
| 54 | led[i].g = 0; | ||
| 55 | led[i].b = 0; | ||
| 56 | } | ||
| 57 | } | ||
| 58 | |||
| 59 | i2c_init(); | ||
| 60 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 61 | } | ||
| 62 | #endif | ||
| 63 | |||
| 64 | __attribute__ ((weak)) | ||
| 65 | void matrix_scan_user(void) { | ||
| 66 | } | ||
| 67 | 18 | ||
| 68 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 69 | // initialize pins D0, D1, D4 and D6 as output | 20 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -72,7 +23,7 @@ void backlight_init_ports(void) { | |||
| 72 | setPinOutput(D4); | 23 | setPinOutput(D4); |
| 73 | setPinOutput(D6); | 24 | setPinOutput(D6); |
| 74 | 25 | ||
| 75 | // turn RGB LEDs on | 26 | // turn backlight LEDs on |
| 76 | writePinHigh(D0); | 27 | writePinHigh(D0); |
| 77 | writePinHigh(D1); | 28 | writePinHigh(D1); |
| 78 | writePinHigh(D4); | 29 | writePinHigh(D4); |
| @@ -80,17 +31,17 @@ void backlight_init_ports(void) { | |||
| 80 | } | 31 | } |
| 81 | 32 | ||
| 82 | void backlight_set(uint8_t level) { | 33 | void backlight_set(uint8_t level) { |
| 83 | if (level == 0) { | 34 | if (level == 0) { |
| 84 | // turn RGB LEDs off | 35 | // turn backlight LEDs off |
| 85 | writePinLow(D0); | 36 | writePinLow(D0); |
| 86 | writePinLow(D1); | 37 | writePinLow(D1); |
| 87 | writePinLow(D4); | 38 | writePinLow(D4); |
| 88 | writePinLow(D6); | 39 | writePinLow(D6); |
| 89 | } else { | 40 | } else { |
| 90 | // turn RGB LEDs on | 41 | // turn backlight LEDs on |
| 91 | writePinHigh(D0); | 42 | writePinHigh(D0); |
| 92 | writePinHigh(D1); | 43 | writePinHigh(D1); |
| 93 | writePinHigh(D4); | 44 | writePinHigh(D4); |
| 94 | writePinHigh(D6); | 45 | writePinHigh(D6); |
| 95 | } | 46 | } |
| 96 | } | 47 | } |
diff --git a/keyboards/exclusive/e6v2/oe_bmc/rules.mk b/keyboards/exclusive/e6v2/oe_bmc/rules.mk index 13a5f1b89..106044ba7 100644 --- a/keyboards/exclusive/e6v2/oe_bmc/rules.mk +++ b/keyboards/exclusive/e6v2/oe_bmc/rules.mk | |||
| @@ -24,7 +24,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | |||
| 24 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 24 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 25 | NKRO_ENABLE = no # USB Nkey Rollover | 25 | NKRO_ENABLE = no # USB Nkey Rollover |
| 26 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default | 26 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default |
| 27 | RGBLIGHT_CUSTOM_DRIVER = yes | 27 | WS2812_DRIVER = i2c |
| 28 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow | 28 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow |
| 29 | MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) | 29 | MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) |
| 30 | UNICODE_ENABLE = no # Unicode | 30 | UNICODE_ENABLE = no # Unicode |
| @@ -34,4 +34,3 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches | |||
| 34 | HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) | 34 | HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) |
| 35 | 35 | ||
| 36 | OPT_DEFS = -DDEBUG_LEVEL=0 | 36 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 37 | SRC += i2c_master.c | ||
diff --git a/keyboards/exent/exent.c b/keyboards/exent/exent.c index 00cd20aff..82066f7e8 100644 --- a/keyboards/exent/exent.c +++ b/keyboards/exent/exent.c | |||
| @@ -15,76 +15,3 @@ | |||
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include "exent.h" | 17 | #include "exent.h" |
| 18 | |||
| 19 | #ifdef RGBLIGHT_ENABLE | ||
| 20 | |||
| 21 | # include <string.h> | ||
| 22 | # include "i2c_master.h" | ||
| 23 | # include "rgblight.h" | ||
| 24 | |||
| 25 | extern rgblight_config_t rgblight_config; | ||
| 26 | |||
| 27 | void matrix_init_kb(void) { | ||
| 28 | i2c_init(); | ||
| 29 | // call user level keymaps, if any | ||
| 30 | matrix_init_user(); | ||
| 31 | } | ||
| 32 | |||
| 33 | // custom RGB driver | ||
| 34 | void rgblight_set(void) { | ||
| 35 | if (!rgblight_config.enable) { | ||
| 36 | memset(led, 0, 3 * RGBLED_NUM); | ||
| 37 | } | ||
| 38 | |||
| 39 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 40 | } | ||
| 41 | |||
| 42 | bool rgb_init = false; | ||
| 43 | |||
| 44 | void matrix_scan_kb(void) { | ||
| 45 | // if LEDs were previously on before poweroff, turn them back on | ||
| 46 | if (rgb_init == false && rgblight_config.enable) { | ||
| 47 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 48 | rgb_init = true; | ||
| 49 | } | ||
| 50 | |||
| 51 | rgblight_task(); | ||
| 52 | matrix_scan_user(); | ||
| 53 | } | ||
| 54 | |||
| 55 | #endif | ||
| 56 | |||
| 57 | // Optional override functions below. | ||
| 58 | // You can leave any or all of these undefined. | ||
| 59 | // These are only required if you want to perform custom actions. | ||
| 60 | |||
| 61 | /* | ||
| 62 | |||
| 63 | void matrix_init_kb(void) { | ||
| 64 | // put your keyboard start-up code here | ||
| 65 | // runs once when the firmware starts up | ||
| 66 | |||
| 67 | matrix_init_user(); | ||
| 68 | } | ||
| 69 | |||
| 70 | void matrix_scan_kb(void) { | ||
| 71 | // put your looping keyboard code here | ||
| 72 | // runs every cycle (a lot) | ||
| 73 | |||
| 74 | matrix_scan_user(); | ||
| 75 | } | ||
| 76 | |||
| 77 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 78 | // put your per-action keyboard code here | ||
| 79 | // runs for every action, just before processing by the firmware | ||
| 80 | |||
| 81 | return process_record_user(keycode, record); | ||
| 82 | } | ||
| 83 | |||
| 84 | void led_set_kb(uint8_t usb_led) { | ||
| 85 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | ||
| 86 | |||
| 87 | led_set_user(usb_led); | ||
| 88 | } | ||
| 89 | |||
| 90 | */ | ||
diff --git a/keyboards/exent/rules.mk b/keyboards/exent/rules.mk index a49f32058..10442b31b 100644 --- a/keyboards/exent/rules.mk +++ b/keyboards/exent/rules.mk | |||
| @@ -19,10 +19,8 @@ CONSOLE_ENABLE = yes | |||
| 19 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 20 | BACKLIGHT_ENABLE = no | 20 | BACKLIGHT_ENABLE = no |
| 21 | RGBLIGHT_ENABLE = yes | 21 | RGBLIGHT_ENABLE = yes |
| 22 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 23 | 23 | ||
| 24 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 25 | 25 | ||
| 26 | SRC += i2c_master.c | ||
| 27 | |||
| 28 | LAYOUTS = 65_ansi 65_iso | 26 | LAYOUTS = 65_ansi 65_iso |
diff --git a/keyboards/facew/facew.c b/keyboards/facew/facew.c index 7ec56548b..fa58f0cf7 100644 --- a/keyboards/facew/facew.c +++ b/keyboards/facew/facew.c | |||
| @@ -16,51 +16,31 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "facew.h" | 18 | #include "facew.h" |
| 19 | #ifdef BACKLIGHT_ENABLE | ||
| 20 | #include "backlight.h" | ||
| 21 | #endif | ||
| 22 | #ifdef RGBLIGHT_ENABLE | ||
| 23 | #include "rgblight.h" | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #include <avr/pgmspace.h> | ||
| 27 | |||
| 28 | #include "action_layer.h" | ||
| 29 | #include "i2c_master.h" | ||
| 30 | #include "quantum.h" | ||
| 31 | |||
| 32 | #ifdef RGBLIGHT_ENABLE | ||
| 33 | extern rgblight_config_t rgblight_config; | ||
| 34 | |||
| 35 | void rgblight_set(void) { | ||
| 36 | if (!rgblight_config.enable) { | ||
| 37 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 38 | led[i].r = 0; | ||
| 39 | led[i].g = 0; | ||
| 40 | led[i].b = 0; | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 44 | i2c_init(); | ||
| 45 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 46 | } | ||
| 47 | #endif | ||
| 48 | |||
| 49 | __attribute__ ((weak)) | ||
| 50 | void matrix_scan_user(void) { | ||
| 51 | } | ||
| 52 | 19 | ||
| 53 | void backlight_init_ports(void) { | 20 | void backlight_init_ports(void) { |
| 54 | DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); | 21 | setPinOutput(D0); |
| 55 | PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); | 22 | setPinOutput(D1); |
| 23 | setPinOutput(D4); | ||
| 24 | setPinOutput(D6); | ||
| 25 | |||
| 26 | writePinLow(D0); | ||
| 27 | writePinLow(D1); | ||
| 28 | writePinLow(D4); | ||
| 29 | writePinLow(D6); | ||
| 56 | } | 30 | } |
| 57 | 31 | ||
| 58 | void backlight_set(uint8_t level) { | 32 | void backlight_set(uint8_t level) { |
| 59 | if (level == 0) { | 33 | if (level == 0) { |
| 60 | // Turn out the lights | 34 | // Turn out the lights |
| 61 | PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); | 35 | writePinLow(D0); |
| 36 | writePinLow(D1); | ||
| 37 | writePinLow(D4); | ||
| 38 | writePinLow(D6); | ||
| 62 | } else { | 39 | } else { |
| 63 | // Turn on the lights | 40 | // Turn on the lights |
| 64 | PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); | 41 | writePinHigh(D0); |
| 42 | writePinHigh(D1); | ||
| 43 | writePinHigh(D4); | ||
| 44 | writePinHigh(D6); | ||
| 65 | } | 45 | } |
| 66 | } | 46 | } |
diff --git a/keyboards/facew/rules.mk b/keyboards/facew/rules.mk index c9942e369..c4117d15d 100644 --- a/keyboards/facew/rules.mk +++ b/keyboards/facew/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,11 +19,8 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = yes | 20 | BACKLIGHT_ENABLE = yes |
| 36 | RGBLIGHT_ENABLE = yes | 21 | RGBLIGHT_ENABLE = yes |
| 37 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | 25 | ||
| 41 | # custom matrix setup | ||
| 42 | SRC = i2c_master.c | ||
| 43 | |||
| 44 | LAYOUTS = 60_ansi | 26 | LAYOUTS = 60_ansi |
diff --git a/keyboards/ft/mars80/mars80.c b/keyboards/ft/mars80/mars80.c index 754345082..8e5127408 100644 --- a/keyboards/ft/mars80/mars80.c +++ b/keyboards/ft/mars80/mars80.c | |||
| @@ -16,50 +16,6 @@ | |||
| 16 | 16 | ||
| 17 | #include "mars80.h" | 17 | #include "mars80.h" |
| 18 | 18 | ||
| 19 | #include "rgblight.h" | ||
| 20 | #include "i2c_master.h" | ||
| 21 | #include "quantum.h" | ||
| 22 | |||
| 23 | #ifdef RGBLIGHT_ENABLE | ||
| 24 | extern rgblight_config_t rgblight_config; | ||
| 25 | |||
| 26 | void rgblight_set(void) { | ||
| 27 | if (!rgblight_config.enable) { | ||
| 28 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 29 | led[i].r = 0; | ||
| 30 | led[i].g = 0; | ||
| 31 | led[i].b = 0; | ||
| 32 | } | ||
| 33 | } | ||
| 34 | |||
| 35 | i2c_init(); | ||
| 36 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 37 | } | ||
| 38 | #endif | ||
| 39 | |||
| 40 | void matrix_init_kb(void) { | ||
| 41 | #ifdef RGBLIGHT_ENABLE | ||
| 42 | if (rgblight_config.enable) { | ||
| 43 | i2c_init(); | ||
| 44 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 45 | } | ||
| 46 | #endif | ||
| 47 | // call user level keymaps, if any | ||
| 48 | matrix_init_user(); | ||
| 49 | } | ||
| 50 | |||
| 51 | void matrix_scan_kb(void) { | ||
| 52 | #ifdef RGBLIGHT_ENABLE | ||
| 53 | rgblight_task(); | ||
| 54 | #endif | ||
| 55 | matrix_scan_user(); | ||
| 56 | /* Nothing else for now. */ | ||
| 57 | } | ||
| 58 | |||
| 59 | __attribute__ ((weak)) | ||
| 60 | void matrix_scan_user(void) { | ||
| 61 | } | ||
| 62 | |||
| 63 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 64 | // initialize pins D0, D1, D4 and D6 as output | 20 | // initialize pins D0, D1, D4 and D6 as output |
| 65 | setPinOutput(D0); | 21 | setPinOutput(D0); |
| @@ -75,17 +31,17 @@ void backlight_init_ports(void) { | |||
| 75 | } | 31 | } |
| 76 | 32 | ||
| 77 | void backlight_set(uint8_t level) { | 33 | void backlight_set(uint8_t level) { |
| 78 | if (level == 0) { | 34 | if (level == 0) { |
| 79 | // turn backlight LEDs off | 35 | // turn backlight LEDs off |
| 80 | writePinLow(D0); | 36 | writePinLow(D0); |
| 81 | writePinLow(D1); | 37 | writePinLow(D1); |
| 82 | writePinLow(D4); | 38 | writePinLow(D4); |
| 83 | writePinLow(D6); | 39 | writePinLow(D6); |
| 84 | } else { | 40 | } else { |
| 85 | // turn backlight LEDs on | 41 | // turn backlight LEDs on |
| 86 | writePinHigh(D0); | 42 | writePinHigh(D0); |
| 87 | writePinHigh(D1); | 43 | writePinHigh(D1); |
| 88 | writePinHigh(D4); | 44 | writePinHigh(D4); |
| 89 | writePinHigh(D6); | 45 | writePinHigh(D6); |
| 90 | } | 46 | } |
| 91 | } \ No newline at end of file | 47 | } |
diff --git a/keyboards/ft/mars80/rules.mk b/keyboards/ft/mars80/rules.mk index f1c79b196..de85d62c8 100644 --- a/keyboards/ft/mars80/rules.mk +++ b/keyboards/ft/mars80/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2019 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,10 +19,8 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = yes | 20 | BACKLIGHT_ENABLE = yes |
| 36 | RGBLIGHT_ENABLE = yes | 21 | RGBLIGHT_ENABLE = yes |
| 37 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | 25 | ||
| 41 | SRC += i2c_master.c | ||
| 42 | |||
| 43 | LAYOUTS = tkl_ansi tkl_iso | 26 | LAYOUTS = tkl_ansi tkl_iso |
diff --git a/keyboards/gray_studio/hb85/hb85.c b/keyboards/gray_studio/hb85/hb85.c index 3e4202358..21562b9e0 100644 --- a/keyboards/gray_studio/hb85/hb85.c +++ b/keyboards/gray_studio/hb85/hb85.c | |||
| @@ -16,33 +16,7 @@ You should have received a copy of the GNU General Public License | |||
| 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #include <string.h> | 19 | #include "hb85.h" |
| 20 | |||
| 21 | #include "rgblight.h" | ||
| 22 | |||
| 23 | #include "i2c_master.h" | ||
| 24 | #include "quantum.h" | ||
| 25 | |||
| 26 | #ifdef RGBLIGHT_ENABLE | ||
| 27 | extern rgblight_config_t rgblight_config; | ||
| 28 | |||
| 29 | void rgblight_set(void) { | ||
| 30 | if (!rgblight_config.enable) { | ||
| 31 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 32 | led[i].r = 0; | ||
| 33 | led[i].g = 0; | ||
| 34 | led[i].b = 0; | ||
| 35 | } | ||
| 36 | } | ||
| 37 | |||
| 38 | i2c_init(); | ||
| 39 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 40 | } | ||
| 41 | #endif | ||
| 42 | |||
| 43 | __attribute__ ((weak)) | ||
| 44 | void matrix_scan_user(void) { | ||
| 45 | } | ||
| 46 | 20 | ||
| 47 | void backlight_init_ports(void) { | 21 | void backlight_init_ports(void) { |
| 48 | // initialize pins D0, D1, D4 and D6 as output | 22 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -51,7 +25,7 @@ void backlight_init_ports(void) { | |||
| 51 | setPinOutput(D4); | 25 | setPinOutput(D4); |
| 52 | setPinOutput(D6); | 26 | setPinOutput(D6); |
| 53 | 27 | ||
| 54 | // turn RGB LEDs on | 28 | // turn backlight LEDs on |
| 55 | writePinHigh(D0); | 29 | writePinHigh(D0); |
| 56 | writePinHigh(D1); | 30 | writePinHigh(D1); |
| 57 | writePinHigh(D4); | 31 | writePinHigh(D4); |
| @@ -59,17 +33,17 @@ void backlight_init_ports(void) { | |||
| 59 | } | 33 | } |
| 60 | 34 | ||
| 61 | void backlight_set(uint8_t level) { | 35 | void backlight_set(uint8_t level) { |
| 62 | if (level == 0) { | 36 | if (level == 0) { |
| 63 | // turn RGB LEDs off | 37 | // turn backlight LEDs off |
| 64 | writePinLow(D0); | 38 | writePinLow(D0); |
| 65 | writePinLow(D1); | 39 | writePinLow(D1); |
| 66 | writePinLow(D4); | 40 | writePinLow(D4); |
| 67 | writePinLow(D6); | 41 | writePinLow(D6); |
| 68 | } else { | 42 | } else { |
| 69 | // turn RGB LEDs on | 43 | // turn backlight LEDs on |
| 70 | writePinHigh(D0); | 44 | writePinHigh(D0); |
| 71 | writePinHigh(D1); | 45 | writePinHigh(D1); |
| 72 | writePinHigh(D4); | 46 | writePinHigh(D4); |
| 73 | writePinHigh(D6); | 47 | writePinHigh(D6); |
| 74 | } | 48 | } |
| 75 | } | 49 | } |
diff --git a/keyboards/gray_studio/hb85/rules.mk b/keyboards/gray_studio/hb85/rules.mk index 5339aad89..ec57b03dc 100644 --- a/keyboards/gray_studio/hb85/rules.mk +++ b/keyboards/gray_studio/hb85/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2019 fcoury <felipe.coury@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = no | 20 | BACKLIGHT_ENABLE = no |
| 36 | RGBLIGHT_ENABLE = yes | 21 | RGBLIGHT_ENABLE = yes |
| 37 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | |||
| 41 | SRC += i2c_master.c | ||
diff --git a/keyboards/jj4x4/jj4x4.c b/keyboards/jj4x4/jj4x4.c index 265508b2d..6330c89de 100644 --- a/keyboards/jj4x4/jj4x4.c +++ b/keyboards/jj4x4/jj4x4.c | |||
| @@ -17,40 +17,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #include "jj4x4.h" | 19 | #include "jj4x4.h" |
| 20 | |||
| 21 | #ifdef RGBLIGHT_ENABLE | ||
| 22 | |||
| 23 | #include <string.h> | ||
| 24 | #include "i2c_master.h" | ||
| 25 | #include "rgblight.h" | ||
| 26 | |||
| 27 | extern rgblight_config_t rgblight_config; | ||
| 28 | |||
| 29 | void matrix_init_kb(void) { | ||
| 30 | i2c_init(); | ||
| 31 | // call user level keymaps, if any | ||
| 32 | matrix_init_user(); | ||
| 33 | } | ||
| 34 | // custom RGB driver | ||
| 35 | void rgblight_set(void) { | ||
| 36 | if (!rgblight_config.enable) { | ||
| 37 | memset(led, 0, 3 * RGBLED_NUM); | ||
| 38 | } | ||
| 39 | |||
| 40 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 41 | } | ||
| 42 | |||
| 43 | bool rgb_init = false; | ||
| 44 | |||
| 45 | void matrix_scan_kb(void) { | ||
| 46 | // if LEDs were previously on before poweroff, turn them back on | ||
| 47 | if (rgb_init == false && rgblight_config.enable) { | ||
| 48 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 49 | rgb_init = true; | ||
| 50 | } | ||
| 51 | |||
| 52 | rgblight_task(); | ||
| 53 | matrix_scan_user(); | ||
| 54 | } | ||
| 55 | |||
| 56 | #endif | ||
diff --git a/keyboards/jj4x4/rules.mk b/keyboards/jj4x4/rules.mk index fedc525f8..aa74cc7c9 100644 --- a/keyboards/jj4x4/rules.mk +++ b/keyboards/jj4x4/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -40,7 +25,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | |||
| 40 | NKRO_ENABLE = no # USB Nkey Rollover | 25 | NKRO_ENABLE = no # USB Nkey Rollover |
| 41 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default | 26 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default |
| 42 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow | 27 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow |
| 43 | RGBLIGHT_CUSTOM_DRIVER = yes | 28 | WS2812_DRIVER = i2c |
| 44 | MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) | 29 | MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) |
| 45 | UNICODE_ENABLE = no # Unicode | 30 | UNICODE_ENABLE = no # Unicode |
| 46 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | 31 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID |
| @@ -48,6 +33,4 @@ AUDIO_ENABLE = no # Audio output on port C6 | |||
| 48 | FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches | 33 | FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches |
| 49 | HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) | 34 | HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) |
| 50 | 35 | ||
| 51 | SRC += i2c_master.c | ||
| 52 | |||
| 53 | LAYOUTS = ortho_4x4 | 36 | LAYOUTS = ortho_4x4 |
diff --git a/keyboards/kbdfans/kbdpad/mk1/mk1.c b/keyboards/kbdfans/kbdpad/mk1/mk1.c index 71a47b7ba..aa781875c 100644 --- a/keyboards/kbdfans/kbdpad/mk1/mk1.c +++ b/keyboards/kbdfans/kbdpad/mk1/mk1.c | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include "quantum.h" | 17 | #include "mk1.h" |
| 18 | 18 | ||
| 19 | #define NUMLOCK_PIN D0 | 19 | #define NUMLOCK_PIN D0 |
| 20 | 20 | ||
diff --git a/keyboards/kbdfans/kbdpad/mk1/rules.mk b/keyboards/kbdfans/kbdpad/mk1/rules.mk index f1f740760..b4cd885b1 100644 --- a/keyboards/kbdfans/kbdpad/mk1/rules.mk +++ b/keyboards/kbdfans/kbdpad/mk1/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
diff --git a/keyboards/panc60/panc60.c b/keyboards/panc60/panc60.c index 16674d30d..6bd16a4bd 100644 --- a/keyboards/panc60/panc60.c +++ b/keyboards/panc60/panc60.c | |||
| @@ -13,52 +13,33 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "panc60.h" | ||
| 17 | #ifdef BACKLIGHT_ENABLE | ||
| 18 | #include "backlight.h" | ||
| 19 | #endif | ||
| 20 | #ifdef RGBLIGHT_ENABLE | ||
| 21 | #include "rgblight.h" | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #include <avr/pgmspace.h> | ||
| 25 | |||
| 26 | #include "action_layer.h" | ||
| 27 | #include "i2c_master.h" | ||
| 28 | #include "quantum.h" | ||
| 29 | |||
| 30 | __attribute__ ((weak)) | ||
| 31 | void matrix_scan_user(void) { | ||
| 32 | } | ||
| 33 | 16 | ||
| 34 | #ifdef RGBLIGHT_ENABLE | 17 | #include "panc60.h" |
| 35 | extern rgblight_config_t rgblight_config; | ||
| 36 | |||
| 37 | void rgblight_set(void) { | ||
| 38 | if (!rgblight_config.enable) { | ||
| 39 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 40 | led[i].r = 0; | ||
| 41 | led[i].g = 0; | ||
| 42 | led[i].b = 0; | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | i2c_init(); | ||
| 47 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 48 | } | ||
| 49 | #endif | ||
| 50 | 18 | ||
| 51 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 52 | DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); | 20 | setPinOutput(D0); |
| 53 | PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); | 21 | setPinOutput(D1); |
| 22 | setPinOutput(D4); | ||
| 23 | setPinOutput(D6); | ||
| 24 | |||
| 25 | writePinLow(D0); | ||
| 26 | writePinLow(D1); | ||
| 27 | writePinLow(D4); | ||
| 28 | writePinLow(D6); | ||
| 54 | } | 29 | } |
| 55 | 30 | ||
| 56 | void backlight_set(uint8_t level) { | 31 | void backlight_set(uint8_t level) { |
| 57 | if (level == 0) { | 32 | if (level == 0) { |
| 58 | // Turn out the lights | 33 | // Turn out the lights |
| 59 | PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); | 34 | writePinLow(D0); |
| 35 | writePinLow(D1); | ||
| 36 | writePinLow(D4); | ||
| 37 | writePinLow(D6); | ||
| 60 | } else { | 38 | } else { |
| 61 | // Turn on the lights | 39 | // Turn on the lights |
| 62 | PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); | 40 | writePinHigh(D0); |
| 41 | writePinHigh(D1); | ||
| 42 | writePinHigh(D4); | ||
| 43 | writePinHigh(D6); | ||
| 63 | } | 44 | } |
| 64 | } | 45 | } |
diff --git a/keyboards/panc60/rules.mk b/keyboards/panc60/rules.mk index cdacb4be7..d3ed4998b 100644 --- a/keyboards/panc60/rules.mk +++ b/keyboards/panc60/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,11 +19,8 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = no | 19 | COMMAND_ENABLE = no |
| 35 | BACKLIGHT_ENABLE = yes | 20 | BACKLIGHT_ENABLE = yes |
| 36 | RGBLIGHT_ENABLE = yes | 21 | RGBLIGHT_ENABLE = yes |
| 37 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | 25 | ||
| 41 | # custom matrix setup | ||
| 42 | SRC = i2c_master.c | ||
| 43 | |||
| 44 | LAYOUTS = 60_ansi 60_hhkb | 26 | LAYOUTS = 60_ansi 60_hhkb |
diff --git a/keyboards/pearl/pearl.c b/keyboards/pearl/pearl.c index c8cd8a860..093b5fdd9 100644 --- a/keyboards/pearl/pearl.c +++ b/keyboards/pearl/pearl.c | |||
| @@ -15,49 +15,7 @@ You should have received a copy of the GNU General Public License | |||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "rgblight.h" | 18 | #include "pearl.h" |
| 19 | #include "i2c_master.h" | ||
| 20 | #include "quantum.h" | ||
| 21 | |||
| 22 | #ifdef RGBLIGHT_ENABLE | ||
| 23 | extern rgblight_config_t rgblight_config; | ||
| 24 | |||
| 25 | void rgblight_set(void) { | ||
| 26 | if (!rgblight_config.enable) { | ||
| 27 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 28 | led[i].r = 0; | ||
| 29 | led[i].g = 0; | ||
| 30 | led[i].b = 0; | ||
| 31 | } | ||
| 32 | } | ||
| 33 | |||
| 34 | i2c_init(); | ||
| 35 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 36 | } | ||
| 37 | #endif | ||
| 38 | |||
| 39 | void matrix_init_kb(void) { | ||
| 40 | #ifdef RGBLIGHT_ENABLE | ||
| 41 | if (rgblight_config.enable) { | ||
| 42 | i2c_init(); | ||
| 43 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 44 | } | ||
| 45 | #endif | ||
| 46 | // call user level keymaps, if any | ||
| 47 | matrix_init_user(); | ||
| 48 | } | ||
| 49 | |||
| 50 | void matrix_scan_kb(void) { | ||
| 51 | #ifdef RGBLIGHT_ENABLE | ||
| 52 | rgblight_task(); | ||
| 53 | #endif | ||
| 54 | matrix_scan_user(); | ||
| 55 | /* Nothing else for now. */ | ||
| 56 | } | ||
| 57 | |||
| 58 | __attribute__ ((weak)) | ||
| 59 | void matrix_scan_user(void) { | ||
| 60 | } | ||
| 61 | 19 | ||
| 62 | void backlight_init_ports(void) { | 20 | void backlight_init_ports(void) { |
| 63 | // initialize pins D0, D1, D4 and D6 as output | 21 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -74,17 +32,17 @@ void backlight_init_ports(void) { | |||
| 74 | } | 32 | } |
| 75 | 33 | ||
| 76 | void backlight_set(uint8_t level) { | 34 | void backlight_set(uint8_t level) { |
| 77 | if (level == 0) { | 35 | if (level == 0) { |
| 78 | // turn backlight LEDs off | 36 | // turn backlight LEDs off |
| 79 | writePinLow(D0); | 37 | writePinLow(D0); |
| 80 | writePinLow(D1); | 38 | writePinLow(D1); |
| 81 | writePinLow(D4); | 39 | writePinLow(D4); |
| 82 | writePinLow(D6); | 40 | writePinLow(D6); |
| 83 | } else { | 41 | } else { |
| 84 | // turn backlight LEDs on | 42 | // turn backlight LEDs on |
| 85 | writePinHigh(D0); | 43 | writePinHigh(D0); |
| 86 | writePinHigh(D1); | 44 | writePinHigh(D1); |
| 87 | writePinHigh(D4); | 45 | writePinHigh(D4); |
| 88 | writePinHigh(D6); | 46 | writePinHigh(D6); |
| 89 | } | 47 | } |
| 90 | } \ No newline at end of file | 48 | } |
diff --git a/keyboards/pearl/rules.mk b/keyboards/pearl/rules.mk index eacf8bb2c..79b783e42 100644 --- a/keyboards/pearl/rules.mk +++ b/keyboards/pearl/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,9 +19,6 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = yes | 20 | BACKLIGHT_ENABLE = yes |
| 36 | RGBLIGHT_ENABLE = yes | 21 | RGBLIGHT_ENABLE = yes |
| 37 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | |||
| 41 | # custom matrix setup | ||
| 42 | SRC = i2c_master.c | ||
diff --git a/keyboards/percent/skog_lite/rules.mk b/keyboards/percent/skog_lite/rules.mk index ed29c47f2..1d2372c77 100644 --- a/keyboards/percent/skog_lite/rules.mk +++ b/keyboards/percent/skog_lite/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,10 +19,8 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = yes | 20 | BACKLIGHT_ENABLE = yes |
| 36 | RGBLIGHT_ENABLE = yes | 21 | RGBLIGHT_ENABLE = yes |
| 37 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | 25 | ||
| 41 | SRC = i2c_master.c | ||
| 42 | |||
| 43 | LAYOUTS = tkl_ansi | 26 | LAYOUTS = tkl_ansi |
diff --git a/keyboards/percent/skog_lite/skog_lite.c b/keyboards/percent/skog_lite/skog_lite.c index a77fc9258..a6c00f529 100644 --- a/keyboards/percent/skog_lite/skog_lite.c +++ b/keyboards/percent/skog_lite/skog_lite.c | |||
| @@ -13,49 +13,8 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "rgblight.h" | ||
| 17 | #include "i2c_master.h" | ||
| 18 | #include "quantum.h" | ||
| 19 | 16 | ||
| 20 | #ifdef RGBLIGHT_ENABLE | 17 | #include "skog_lite.h" |
| 21 | extern rgblight_config_t rgblight_config; | ||
| 22 | |||
| 23 | void rgblight_set(void) { | ||
| 24 | if (!rgblight_config.enable) { | ||
| 25 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 26 | led[i].r = 0; | ||
| 27 | led[i].g = 0; | ||
| 28 | led[i].b = 0; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | i2c_init(); | ||
| 33 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 34 | } | ||
| 35 | #endif | ||
| 36 | |||
| 37 | void matrix_init_kb(void) { | ||
| 38 | #ifdef RGBLIGHT_ENABLE | ||
| 39 | if (rgblight_config.enable) { | ||
| 40 | i2c_init(); | ||
| 41 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 42 | } | ||
| 43 | #endif | ||
| 44 | // call user level keymaps, if any | ||
| 45 | matrix_init_user(); | ||
| 46 | } | ||
| 47 | |||
| 48 | void matrix_scan_kb(void) { | ||
| 49 | #ifdef RGBLIGHT_ENABLE | ||
| 50 | rgblight_task(); | ||
| 51 | #endif | ||
| 52 | matrix_scan_user(); | ||
| 53 | /* Nothing else for now. */ | ||
| 54 | } | ||
| 55 | |||
| 56 | __attribute__ ((weak)) | ||
| 57 | void matrix_scan_user(void) { | ||
| 58 | } | ||
| 59 | 18 | ||
| 60 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 61 | // initialize pins D0, D1, D4 and D6 as output | 20 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -72,17 +31,17 @@ void backlight_init_ports(void) { | |||
| 72 | } | 31 | } |
| 73 | 32 | ||
| 74 | void backlight_set(uint8_t level) { | 33 | void backlight_set(uint8_t level) { |
| 75 | if (level == 0) { | 34 | if (level == 0) { |
| 76 | // turn backlight LEDs off | 35 | // turn backlight LEDs off |
| 77 | writePinLow(D0); | 36 | writePinLow(D0); |
| 78 | writePinLow(D1); | 37 | writePinLow(D1); |
| 79 | writePinLow(D4); | 38 | writePinLow(D4); |
| 80 | writePinLow(D6); | 39 | writePinLow(D6); |
| 81 | } else { | 40 | } else { |
| 82 | // turn backlight LEDs on | 41 | // turn backlight LEDs on |
| 83 | writePinHigh(D0); | 42 | writePinHigh(D0); |
| 84 | writePinHigh(D1); | 43 | writePinHigh(D1); |
| 85 | writePinHigh(D4); | 44 | writePinHigh(D4); |
| 86 | writePinHigh(D6); | 45 | writePinHigh(D6); |
| 87 | } | 46 | } |
| 88 | } | 47 | } |
diff --git a/keyboards/singa/rules.mk b/keyboards/singa/rules.mk index df2a59e90..54328d248 100644 --- a/keyboards/singa/rules.mk +++ b/keyboards/singa/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = yes | 20 | BACKLIGHT_ENABLE = yes |
| 36 | RGBLIGHT_ENABLE = yes | 21 | RGBLIGHT_ENABLE = yes |
| 37 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | |||
| 41 | SRC = i2c_master.c | ||
diff --git a/keyboards/singa/singa.c b/keyboards/singa/singa.c index ee49ba65c..144065d02 100644 --- a/keyboards/singa/singa.c +++ b/keyboards/singa/singa.c | |||
| @@ -13,49 +13,8 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "rgblight.h" | ||
| 17 | #include "i2c_master.h" | ||
| 18 | #include "quantum.h" | ||
| 19 | 16 | ||
| 20 | #ifdef RGBLIGHT_ENABLE | 17 | #include "singa.h" |
| 21 | extern rgblight_config_t rgblight_config; | ||
| 22 | |||
| 23 | void rgblight_set(void) { | ||
| 24 | if (!rgblight_config.enable) { | ||
| 25 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 26 | led[i].r = 0; | ||
| 27 | led[i].g = 0; | ||
| 28 | led[i].b = 0; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | i2c_init(); | ||
| 33 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 34 | } | ||
| 35 | #endif | ||
| 36 | |||
| 37 | void matrix_init_kb(void) { | ||
| 38 | #ifdef RGBLIGHT_ENABLE | ||
| 39 | if (rgblight_config.enable) { | ||
| 40 | i2c_init(); | ||
| 41 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 42 | } | ||
| 43 | #endif | ||
| 44 | // call user level keymaps, if any | ||
| 45 | matrix_init_user(); | ||
| 46 | } | ||
| 47 | |||
| 48 | void matrix_scan_kb(void) { | ||
| 49 | #ifdef RGBLIGHT_ENABLE | ||
| 50 | rgblight_task(); | ||
| 51 | #endif | ||
| 52 | matrix_scan_user(); | ||
| 53 | /* Nothing else for now. */ | ||
| 54 | } | ||
| 55 | |||
| 56 | __attribute__ ((weak)) | ||
| 57 | void matrix_scan_user(void) { | ||
| 58 | } | ||
| 59 | 18 | ||
| 60 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 61 | // initialize pins D0, D1, D4 and D6 as output | 20 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -72,17 +31,17 @@ void backlight_init_ports(void) { | |||
| 72 | } | 31 | } |
| 73 | 32 | ||
| 74 | void backlight_set(uint8_t level) { | 33 | void backlight_set(uint8_t level) { |
| 75 | if (level == 0) { | 34 | if (level == 0) { |
| 76 | // turn backlight LEDs off | 35 | // turn backlight LEDs off |
| 77 | writePinLow(D0); | 36 | writePinLow(D0); |
| 78 | writePinLow(D1); | 37 | writePinLow(D1); |
| 79 | writePinLow(D4); | 38 | writePinLow(D4); |
| 80 | writePinLow(D6); | 39 | writePinLow(D6); |
| 81 | } else { | 40 | } else { |
| 82 | // turn backlight LEDs on | 41 | // turn backlight LEDs on |
| 83 | writePinHigh(D0); | 42 | writePinHigh(D0); |
| 84 | writePinHigh(D1); | 43 | writePinHigh(D1); |
| 85 | writePinHigh(D4); | 44 | writePinHigh(D4); |
| 86 | writePinHigh(D6); | 45 | writePinHigh(D6); |
| 87 | } | 46 | } |
| 88 | } | 47 | } |
diff --git a/keyboards/tgr/alice/alice.c b/keyboards/tgr/alice/alice.c index adb88fef0..39aed2cf5 100644 --- a/keyboards/tgr/alice/alice.c +++ b/keyboards/tgr/alice/alice.c | |||
| @@ -15,41 +15,4 @@ You should have received a copy of the GNU General Public License | |||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <string.h> | 18 | #include "alice.h" |
| 19 | |||
| 20 | #include "rgblight.h" | ||
| 21 | |||
| 22 | #include "i2c_master.h" | ||
| 23 | #include "quantum.h" | ||
| 24 | |||
| 25 | #ifdef RGBLIGHT_ENABLE | ||
| 26 | extern rgblight_config_t rgblight_config; | ||
| 27 | |||
| 28 | void matrix_init_kb(void) { | ||
| 29 | i2c_init(); | ||
| 30 | // call user level keymaps, if any | ||
| 31 | matrix_init_user(); | ||
| 32 | } | ||
| 33 | |||
| 34 | // custom RGB driver | ||
| 35 | void rgblight_set(void) { | ||
| 36 | if (!rgblight_config.enable) { | ||
| 37 | memset(led, 0, 3 * RGBLED_NUM); | ||
| 38 | } | ||
| 39 | |||
| 40 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 41 | } | ||
| 42 | |||
| 43 | bool rgb_init = false; | ||
| 44 | |||
| 45 | void matrix_scan_kb(void) { | ||
| 46 | // if LEDs were previously on before poweroff, turn them back on | ||
| 47 | if (rgb_init == false && rgblight_config.enable) { | ||
| 48 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 49 | rgb_init = true; | ||
| 50 | } | ||
| 51 | |||
| 52 | rgblight_task(); | ||
| 53 | matrix_scan_user(); | ||
| 54 | } | ||
| 55 | #endif | ||
diff --git a/keyboards/tgr/alice/rules.mk b/keyboards/tgr/alice/rules.mk index aa141f7c3..530e8ea32 100644 --- a/keyboards/tgr/alice/rules.mk +++ b/keyboards/tgr/alice/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = no | 20 | BACKLIGHT_ENABLE = no |
| 36 | RGBLIGHT_ENABLE = yes | 21 | RGBLIGHT_ENABLE = yes |
| 37 | RGBLIGHT_CUSTOM_DRIVER = yes | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | |||
| 41 | SRC += i2c_master.c | ||
diff --git a/keyboards/tgr/jane/jane.c b/keyboards/tgr/jane/jane.c index c17cb0084..4ab0b3007 100644 --- a/keyboards/tgr/jane/jane.c +++ b/keyboards/tgr/jane/jane.c | |||
| @@ -13,49 +13,8 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "i2c_master.h" | ||
| 17 | #include "quantum.h" | ||
| 18 | 16 | ||
| 19 | #ifdef RGBLIGHT_ENABLE | 17 | #include "jane.h" |
| 20 | #include "rgblight.h" | ||
| 21 | extern rgblight_config_t rgblight_config; | ||
| 22 | |||
| 23 | void rgblight_set(void) { | ||
| 24 | if (!rgblight_config.enable) { | ||
| 25 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 26 | led[i].r = 0; | ||
| 27 | led[i].g = 0; | ||
| 28 | led[i].b = 0; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | i2c_init(); | ||
| 33 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 34 | } | ||
| 35 | #endif | ||
| 36 | |||
| 37 | void matrix_init_kb(void) { | ||
| 38 | #ifdef RGBLIGHT_ENABLE | ||
| 39 | if (rgblight_config.enable) { | ||
| 40 | i2c_init(); | ||
| 41 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 42 | } | ||
| 43 | #endif | ||
| 44 | // call user level keymaps, if any | ||
| 45 | matrix_init_user(); | ||
| 46 | } | ||
| 47 | |||
| 48 | void matrix_scan_kb(void) { | ||
| 49 | #ifdef RGBLIGHT_ENABLE | ||
| 50 | rgblight_task(); | ||
| 51 | #endif | ||
| 52 | matrix_scan_user(); | ||
| 53 | /* Nothing else for now. */ | ||
| 54 | } | ||
| 55 | |||
| 56 | __attribute__ ((weak)) | ||
| 57 | void matrix_scan_user(void) { | ||
| 58 | } | ||
| 59 | 18 | ||
| 60 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 61 | // initialize pins D0, D1, D4 and D6 as output | 20 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -72,17 +31,17 @@ void backlight_init_ports(void) { | |||
| 72 | } | 31 | } |
| 73 | 32 | ||
| 74 | void backlight_set(uint8_t level) { | 33 | void backlight_set(uint8_t level) { |
| 75 | if (level == 0) { | 34 | if (level == 0) { |
| 76 | // turn backlight LEDs off | 35 | // turn backlight LEDs off |
| 77 | writePinLow(D0); | 36 | writePinLow(D0); |
| 78 | writePinLow(D1); | 37 | writePinLow(D1); |
| 79 | writePinLow(D4); | 38 | writePinLow(D4); |
| 80 | writePinLow(D6); | 39 | writePinLow(D6); |
| 81 | } else { | 40 | } else { |
| 82 | // turn backlight LEDs on | 41 | // turn backlight LEDs on |
| 83 | writePinHigh(D0); | 42 | writePinHigh(D0); |
| 84 | writePinHigh(D1); | 43 | writePinHigh(D1); |
| 85 | writePinHigh(D4); | 44 | writePinHigh(D4); |
| 86 | writePinHigh(D6); | 45 | writePinHigh(D6); |
| 87 | } | 46 | } |
| 88 | } \ No newline at end of file | 47 | } |
diff --git a/keyboards/tgr/jane/rules.mk b/keyboards/tgr/jane/rules.mk index f2b488306..c6a26d4a4 100644 --- a/keyboards/tgr/jane/rules.mk +++ b/keyboards/tgr/jane/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,10 +19,8 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = yes | 20 | BACKLIGHT_ENABLE = yes |
| 36 | RGBLIGHT_ENABLE = no | 21 | RGBLIGHT_ENABLE = no |
| 37 | RGBLIGHT_CUSTOM_DRIVER = no | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | 25 | ||
| 41 | QUANTUM_LIB_SRC = i2c_master.c | ||
| 42 | |||
| 43 | LAYOUTS = tkl_ansi tkl_iso | 26 | LAYOUTS = tkl_ansi tkl_iso |
diff --git a/keyboards/unikorn/readme.md b/keyboards/unikorn/readme.md index 3175cddc2..1f8b16d64 100644 --- a/keyboards/unikorn/readme.md +++ b/keyboards/unikorn/readme.md | |||
| @@ -18,7 +18,6 @@ To enable RGB lighting support, install the necessary components and set RGBLIGH | |||
| 18 | 18 | ||
| 19 | ``` | 19 | ``` |
| 20 | RGBLIGHT_ENABLE = yes | 20 | RGBLIGHT_ENABLE = yes |
| 21 | RGBLIGHT_CUSTOM_DRIVER = yes | ||
| 22 | ``` | 21 | ``` |
| 23 | 22 | ||
| 24 | 23 | ||
diff --git a/keyboards/unikorn/rules.mk b/keyboards/unikorn/rules.mk index d4f4d2aaf..e57c21c85 100644 --- a/keyboards/unikorn/rules.mk +++ b/keyboards/unikorn/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes | |||
| 34 | COMMAND_ENABLE = yes | 19 | COMMAND_ENABLE = yes |
| 35 | BACKLIGHT_ENABLE = yes | 20 | BACKLIGHT_ENABLE = yes |
| 36 | RGBLIGHT_ENABLE = no | 21 | RGBLIGHT_ENABLE = no |
| 37 | RGBLIGHT_CUSTOM_DRIVER = no | 22 | WS2812_DRIVER = i2c |
| 38 | 23 | ||
| 39 | OPT_DEFS = -DDEBUG_LEVEL=0 | 24 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 40 | |||
| 41 | SRC = i2c_master.c | ||
diff --git a/keyboards/unikorn/unikorn.c b/keyboards/unikorn/unikorn.c index 1bd47ef9e..70bc5a988 100644 --- a/keyboards/unikorn/unikorn.c +++ b/keyboards/unikorn/unikorn.c | |||
| @@ -14,49 +14,7 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include "i2c_master.h" | 17 | #include "unikorn.h" |
| 18 | #include "quantum.h" | ||
| 19 | |||
| 20 | #ifdef RGBLIGHT_ENABLE | ||
| 21 | #include "rgblight.h" | ||
| 22 | extern rgblight_config_t rgblight_config; | ||
| 23 | |||
| 24 | void rgblight_set(void) { | ||
| 25 | if (!rgblight_config.enable) { | ||
| 26 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 27 | led[i].r = 0; | ||
| 28 | led[i].g = 0; | ||
| 29 | led[i].b = 0; | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | i2c_init(); | ||
| 34 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 35 | } | ||
| 36 | #endif | ||
| 37 | |||
| 38 | void matrix_init_kb(void) { | ||
| 39 | #ifdef RGBLIGHT_ENABLE | ||
| 40 | if (rgblight_config.enable) { | ||
| 41 | i2c_init(); | ||
| 42 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 43 | } | ||
| 44 | #endif | ||
| 45 | // call user level keymaps, if any | ||
| 46 | matrix_init_user(); | ||
| 47 | } | ||
| 48 | |||
| 49 | void matrix_scan_kb(void) { | ||
| 50 | #ifdef RGBLIGHT_ENABLE | ||
| 51 | rgblight_task(); | ||
| 52 | #endif | ||
| 53 | matrix_scan_user(); | ||
| 54 | /* Nothing else for now. */ | ||
| 55 | } | ||
| 56 | |||
| 57 | __attribute__ ((weak)) | ||
| 58 | void matrix_scan_user(void) { | ||
| 59 | } | ||
| 60 | 18 | ||
| 61 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 62 | // initialize pins D0, D1, D4 and D6 as output | 20 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -73,17 +31,17 @@ void backlight_init_ports(void) { | |||
| 73 | } | 31 | } |
| 74 | 32 | ||
| 75 | void backlight_set(uint8_t level) { | 33 | void backlight_set(uint8_t level) { |
| 76 | if (level == 0) { | 34 | if (level == 0) { |
| 77 | // turn backlight LEDs off | 35 | // turn backlight LEDs off |
| 78 | writePinLow(D0); | 36 | writePinLow(D0); |
| 79 | writePinLow(D1); | 37 | writePinLow(D1); |
| 80 | writePinLow(D4); | 38 | writePinLow(D4); |
| 81 | writePinLow(D6); | 39 | writePinLow(D6); |
| 82 | } else { | 40 | } else { |
| 83 | // turn backlight LEDs on | 41 | // turn backlight LEDs on |
| 84 | writePinHigh(D0); | 42 | writePinHigh(D0); |
| 85 | writePinHigh(D1); | 43 | writePinHigh(D1); |
| 86 | writePinHigh(D4); | 44 | writePinHigh(D4); |
| 87 | writePinHigh(D6); | 45 | writePinHigh(D6); |
| 88 | } | 46 | } |
| 89 | } | 47 | } |
diff --git a/keyboards/winkeyless/bface/bface.c b/keyboards/winkeyless/bface/bface.c index 1c83be4b8..8cb5b600c 100644 --- a/keyboards/winkeyless/bface/bface.c +++ b/keyboards/winkeyless/bface/bface.c | |||
| @@ -13,49 +13,8 @@ | |||
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "rgblight.h" | ||
| 17 | #include "i2c_master.h" | ||
| 18 | #include "quantum.h" | ||
| 19 | 16 | ||
| 20 | #ifdef RGBLIGHT_ENABLE | 17 | #include "bface.h" |
| 21 | extern rgblight_config_t rgblight_config; | ||
| 22 | |||
| 23 | void rgblight_set(void) { | ||
| 24 | if (!rgblight_config.enable) { | ||
| 25 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
| 26 | led[i].r = 0; | ||
| 27 | led[i].g = 0; | ||
| 28 | led[i].b = 0; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | i2c_init(); | ||
| 33 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 34 | } | ||
| 35 | #endif | ||
| 36 | |||
| 37 | void matrix_init_kb(void) { | ||
| 38 | #ifdef RGBLIGHT_ENABLE | ||
| 39 | if (rgblight_config.enable) { | ||
| 40 | i2c_init(); | ||
| 41 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
| 42 | } | ||
| 43 | #endif | ||
| 44 | // call user level keymaps, if any | ||
| 45 | matrix_init_user(); | ||
| 46 | } | ||
| 47 | |||
| 48 | void matrix_scan_kb(void) { | ||
| 49 | #ifdef RGBLIGHT_ENABLE | ||
| 50 | rgblight_task(); | ||
| 51 | #endif | ||
| 52 | matrix_scan_user(); | ||
| 53 | /* Nothing else for now. */ | ||
| 54 | } | ||
| 55 | |||
| 56 | __attribute__ ((weak)) | ||
| 57 | void matrix_scan_user(void) { | ||
| 58 | } | ||
| 59 | 18 | ||
| 60 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
| 61 | // initialize pins D0, D1, D4 and D6 as output | 20 | // initialize pins D0, D1, D4 and D6 as output |
| @@ -72,17 +31,17 @@ void backlight_init_ports(void) { | |||
| 72 | } | 31 | } |
| 73 | 32 | ||
| 74 | void backlight_set(uint8_t level) { | 33 | void backlight_set(uint8_t level) { |
| 75 | if (level == 0) { | 34 | if (level == 0) { |
| 76 | // turn backlight LEDs off | 35 | // turn backlight LEDs off |
| 77 | writePinLow(D0); | 36 | writePinLow(D0); |
| 78 | writePinLow(D1); | 37 | writePinLow(D1); |
| 79 | writePinLow(D4); | 38 | writePinLow(D4); |
| 80 | writePinLow(D6); | 39 | writePinLow(D6); |
| 81 | } else { | 40 | } else { |
| 82 | // turn backlight LEDs on | 41 | // turn backlight LEDs on |
| 83 | writePinHigh(D0); | 42 | writePinHigh(D0); |
| 84 | writePinHigh(D1); | 43 | writePinHigh(D1); |
| 85 | writePinHigh(D4); | 44 | writePinHigh(D4); |
| 86 | writePinHigh(D6); | 45 | writePinHigh(D6); |
| 87 | } | 46 | } |
| 88 | } | 47 | } |
diff --git a/keyboards/winkeyless/bface/bface.h b/keyboards/winkeyless/bface/bface.h index f7a3b9521..bca0c24c1 100644 --- a/keyboards/winkeyless/bface/bface.h +++ b/keyboards/winkeyless/bface/bface.h | |||
| @@ -18,9 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 18 | 18 | ||
| 19 | #pragma once | 19 | #pragma once |
| 20 | 20 | ||
| 21 | #include "quantum_keycodes.h" | 21 | #include "quantum.h" |
| 22 | #include "keycode.h" | ||
| 23 | #include "action.h" | ||
| 24 | 22 | ||
| 25 | #define LAYOUT_60_ansi( \ | 23 | #define LAYOUT_60_ansi( \ |
| 26 | K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \ | 24 | K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \ |
diff --git a/keyboards/winkeyless/bface/rules.mk b/keyboards/winkeyless/bface/rules.mk index 12b502785..506e37ac9 100644 --- a/keyboards/winkeyless/bface/rules.mk +++ b/keyboards/winkeyless/bface/rules.mk | |||
| @@ -1,18 +1,3 @@ | |||
| 1 | # Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | # MCU name | 1 | # MCU name |
| 17 | MCU = atmega32a | 2 | MCU = atmega32a |
| 18 | 3 | ||
| @@ -36,9 +21,6 @@ BACKLIGHT_ENABLE = yes | |||
| 36 | BACKLIGHT_CUSTOM_DRIVER = yes | 21 | BACKLIGHT_CUSTOM_DRIVER = yes |
| 37 | BACKLIGHT_BREATHING = no | 22 | BACKLIGHT_BREATHING = no |
| 38 | RGBLIGHT_ENABLE = yes | 23 | RGBLIGHT_ENABLE = yes |
| 39 | RGBLIGHT_CUSTOM_DRIVER = yes | 24 | WS2812_DRIVER = i2c |
| 40 | 25 | ||
| 41 | OPT_DEFS = -DDEBUG_LEVEL=0 | 26 | OPT_DEFS = -DDEBUG_LEVEL=0 |
| 42 | |||
| 43 | # custom matrix setup | ||
| 44 | SRC = i2c_master.c | ||
