summaryrefslogtreecommitdiff
path: root/keyboards/phantom
diff options
context:
space:
mode:
authorChristopher Browne <cbbrowne@ca.afilias.info>2016-07-12 11:57:15 -0400
committerChristopher Browne <cbbrowne@ca.afilias.info>2016-07-12 11:57:15 -0400
commitf4fbfe6e544bb2beab05464a23ab848ae4c5578a (patch)
tree3adffe7bfb24ded332e3f8bd0366a2fd2f2db7e3 /keyboards/phantom
parent477ed703c88822aea62152d62fb2310267edc48f (diff)
parenta998a48673372e409991066d7d2d9ba282f79d59 (diff)
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'keyboards/phantom')
-rw-r--r--keyboards/phantom/config.h13
-rw-r--r--keyboards/phantom/keymaps/default/keymap.c69
-rw-r--r--keyboards/phantom/led.c2
3 files changed, 8 insertions, 76 deletions
diff --git a/keyboards/phantom/config.h b/keyboards/phantom/config.h
index d5878766f0..983a1d73f2 100644
--- a/keyboards/phantom/config.h
+++ b/keyboards/phantom/config.h
@@ -62,13 +62,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Underlight configuration
*/
- #define ws2812_PORTREG PORTE
- #define ws2812_DDRREG DDRE
- #define ws2812_pin 2
- #define RGBLED_NUM 20 // Number of LEDs
- #define RGBLIGHT_HUE_STEP 10
- #define RGBLIGHT_SAT_STEP 17
- #define RGBLIGHT_VAL_STEP 17
+#define RGB_DI_PIN E2
+#define RGBLIGHT_TIMER
+#define RGBLED_NUM 20 // Number of LEDs
+#define RGBLIGHT_HUE_STEP 10
+#define RGBLIGHT_SAT_STEP 17
+#define RGBLIGHT_VAL_STEP 17
/*
* Feature disable options
diff --git a/keyboards/phantom/keymaps/default/keymap.c b/keyboards/phantom/keymaps/default/keymap.c
index 1368226aa9..a4fc319ac8 100644
--- a/keyboards/phantom/keymaps/default/keymap.c
+++ b/keyboards/phantom/keymaps/default/keymap.c
@@ -1,9 +1,5 @@
#include "phantom.h"
-#ifdef RGBLIGHT_ENABLE
-#include "rgblight.h"
-#endif
-
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
@@ -59,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, \
- KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
+ KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
#else
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
@@ -73,30 +69,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
enum function_id {
SHIFT_ESC,
- #ifdef RGBLIGHT_ENABLE
- RGBLED_TOGGLE,
- RGBLED_STEP_MODE,
- RGBLED_INCREASE_HUE,
- RGBLED_DECREASE_HUE,
- RGBLED_INCREASE_SAT,
- RGBLED_DECREASE_SAT,
- RGBLED_INCREASE_VAL,
- RGBLED_DECREASE_VAL
- #endif
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
- #ifdef RGBLIGHT_ENABLE
- [1] = ACTION_FUNCTION(RGBLED_TOGGLE),
- [2] = ACTION_FUNCTION(RGBLED_STEP_MODE),
- [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
- [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
- [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
- [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
- [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
- [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
- #endif
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
@@ -122,48 +98,5 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
}
}
break;
- //led operations
- #ifdef RGBLIGHT_ENABLE
- case RGBLED_TOGGLE:
- if (record->event.pressed) {
- rgblight_toggle();
- }
- break;
- case RGBLED_INCREASE_HUE:
- if (record->event.pressed) {
- rgblight_increase_hue();
- }
- break;
- case RGBLED_DECREASE_HUE:
- if (record->event.pressed) {
- rgblight_decrease_hue();
- }
- break;
- case RGBLED_INCREASE_SAT:
- if (record->event.pressed) {
- rgblight_increase_sat();
- }
- break;
- case RGBLED_DECREASE_SAT:
- if (record->event.pressed) {
- rgblight_decrease_sat();
- }
- break;
- case RGBLED_INCREASE_VAL:
- if (record->event.pressed) {
- rgblight_increase_val();
- }
- break;
- case RGBLED_DECREASE_VAL:
- if (record->event.pressed) {
- rgblight_decrease_val();
- }
- break;
- case RGBLED_STEP_MODE:
- if (record->event.pressed) {
- rgblight_step();
- }
- break;
- #endif
}
}
diff --git a/keyboards/phantom/led.c b/keyboards/phantom/led.c
index b2459c7743..69dba7d40e 100644
--- a/keyboards/phantom/led.c
+++ b/keyboards/phantom/led.c
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdint.h"
#include "led.h"
-void led_init(void) {
+void led_init_ports(void) {
// * Set our LED pins as output
DDRB |= (1<<6);
DDRB |= (1<<7);