diff options
author | marhalloweenvt <marhalloweenvt@gmail.com> | 2019-12-08 14:11:21 +0700 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-12-07 23:11:21 -0800 |
commit | a7209533a35f77b18997b250e16917d5ae666933 (patch) | |
tree | bd8bd1e9b81d32781c2dccd85e5fdaec474f7f29 /keyboards/handwired/colorlice/colorlice.c | |
parent | 3d78e6078e402bf0fe476adeed8ac16033f916c0 (diff) | |
download | firmware-a7209533a35f77b18997b250e16917d5ae666933.tar.gz firmware-a7209533a35f77b18997b250e16917d5ae666933.tar.bz2 firmware-a7209533a35f77b18997b250e16917d5ae666933.zip |
[Keyboard] Add new keyboard ColorLice (#7536)
* [Keyboard] Add new keyboard Symmetry60
* Add new keyboard Symmetry60
* Fix Typo
* Update keyboards/handwired/symmetry60/config.h
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update keyboards/handwired/symmetry60/readme.md
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update keyboards/handwired/symmetry60/readme.md
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update keyboards/handwired/symmetry60/readme.md
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update keyboards/handwired/symmetry60/rules.mk
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/handwired/symmetry60/symmetry60.h
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/handwired/symmetry60/symmetry60.h
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/handwired/symmetry60/symmetry60.h
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update readme.md
* Update keymap.c
* Update keymap.c
* Update keymap.c
* Update rules.mk
* Update symmetry60.c
* Update keyboards/handwired/symmetry60/rules.mk
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Add ColorLice
* Update ColorLice
- Adjust info.json to support Configurator
- Adjust layout name to fit with info.json
- Seperate 2 feature: RGB Switch and RGB Underglow
* Update new way of control lock leds
* Remove #ifndef COLORLICE_H
* Update make example
* Revert Helix
* Revert Helix
* Revert Helix
* Revert Helix
* Update keyboards/handwired/colorlice/colorlice.h
Co-Authored-By: Joel Challis <git@zvecr.com>
* Update keyboards/handwired/colorlice/colorlice.h
Co-Authored-By: Joel Challis <git@zvecr.com>
* Update default keymap
* Revert Helix
* Update keyboards/handwired/colorlice/readme.md
Co-Authored-By: Joel Challis <git@zvecr.com>
* Update keyboards/handwired/colorlice/rules.mk
Co-Authored-By: Joel Challis <git@zvecr.com>
* Update keyboards/handwired/colorlice/colorlice.c
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/handwired/colorlice/colorlice.c
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Remove unnecessary function
* Update keyboards/handwired/colorlice/colorlice.c
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Adjust rules option for working with Configurator
- Move RGB_MATRIX_ENABLE and RGBLIGHT_ENABLE to keyboard rule.
- Add RGB_DI_PIN in keyboard config
* Update keyboards/helix/rev2/keymaps/default/keymap.c
Co-Authored-By: Joel Challis <git@zvecr.com>
* Update keyboards/handwired/colorlice/readme.md
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
* Update keymap for Colorlice
* Adjust rules.mk to use space indent
Diffstat (limited to 'keyboards/handwired/colorlice/colorlice.c')
-rw-r--r-- | keyboards/handwired/colorlice/colorlice.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/keyboards/handwired/colorlice/colorlice.c b/keyboards/handwired/colorlice/colorlice.c new file mode 100644 index 000000000..1fd5fddd1 --- /dev/null +++ b/keyboards/handwired/colorlice/colorlice.c @@ -0,0 +1,67 @@ +/* Copyright 2019 marhalloweenvt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include "colorlice.h" + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, NO_LED }, + { 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, NO_LED, 44, NO_LED }, + { 58, 57, 56, 55, 54, 53, NO_LED, 52, 51, 50, 49, 48, 47, 46, 45, NO_LED}, + { 59, NO_LED, 60, 61, 62, NO_LED, NO_LED,63, NO_LED, NO_LED, 64, 65,66,67, 68, NO_LED } +}, { + { 0, 0 }, { 15, 0 }, { 30, 0 }, { 45, 0 }, { 60, 0 }, { 75, 0 }, { 90, 0 }, { 105, 0 }, { 120, 0 }, { 135, 0 }, { 150, 0 }, { 165, 0 }, { 180, 0 }, { 195, 0 }, { 210, 0 }, { 224, 0 }, + { 224, 16 }, { 210, 16 }, { 195, 16 }, { 180, 16 }, { 165, 16 }, { 150, 16 }, { 135, 16 }, { 120, 16 }, { 90, 16 }, { 75, 16 }, { 60, 16 }, { 45, 16 }, { 30, 16 }, { 15, 16 }, { 0, 16 }, + { 0, 32 }, { 15, 32 }, { 30, 32 }, { 45, 32 }, { 60, 32 }, { 75, 32 }, { 90, 32 }, { 135, 32 }, { 150, 32 }, { 165, 32 }, { 180, 32 }, { 195, 32 }, { 210, 32 }, { 224, 32 }, + { 225, 48 }, { 224, 48 }, { 210, 48 }, { 195, 48 }, { 180, 48 }, { 165, 48 }, { 150, 48 }, { 135, 48 }, { 90, 48 }, { 75, 48 }, { 60, 48 }, { 45, 48 }, { 30, 48 }, { 15, 48 }, + { 15, 64 }, { 45, 64 }, { 75, 64 }, { 90, 64 }, { 150, 64 }, { 180, 64 }, { 210, 64 }, { 215, 64 }, { 220, 64 }, { 225, 64 } +}, { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +} }; +#endif + +#ifdef RGB_MATRIX_ENABLE +void suspend_power_down_kb(void) +{ + rgb_matrix_set_suspend_state(true); + suspend_power_down_user(); +} + +void suspend_wakeup_init_kb(void) +{ + rgb_matrix_set_suspend_state(false); + suspend_wakeup_init_user(); +} +#endif + +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { + // writePin sets the pin high for 1 and low for 0. + // In this example the pins are inverted, setting + // it low/0 turns it on, and high/1 turns the LED off. + // This behavior depends on whether the LED is between the pin + // and VCC or the pin and GND. + writePin(B2, !led_state.num_lock); + writePin(C6, !led_state.caps_lock); + writePin(B7, !led_state.scroll_lock); + } + return res; +} |