1
0
Fork 0

Promethium update: demo LED, fix PS2 delay, fix LED ordering, change click frequency

This commit is contained in:
Priyadi Iman Nurcahyo 2017-04-29 13:21:27 +07:00
parent f9d226ca50
commit d8f1949029
4 changed files with 55 additions and 22 deletions

View file

@ -153,7 +153,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_MACRO //#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION //#define NO_ACTION_FUNCTION
#define PS2_INIT_DELAY 3000 #define PS2_MOUSE_INIT_DELAY 2000
#define BATTERY_PIN 9 #define BATTERY_PIN 9
#define BATTERY_POLL 30000 #define BATTERY_POLL 30000
#define MAX_VOLTAGE 4.2 #define MAX_VOLTAGE 4.2
@ -234,35 +234,35 @@ enum led_sequence {
LED_TRACKPOINT2, LED_TRACKPOINT2,
LED_TRACKPOINT1, LED_TRACKPOINT1,
LED_LSPC,
LED_B,
LED_G,
LED_T, LED_T,
LED_G,
LED_B,
LED_LSPC,
LED_R,
LED_F,
LED_V,
LED_NUM, LED_NUM,
LED_V,
LED_F,
LED_R,
LED_EMPTY,
LED_C,
LED_D,
LED_E, LED_E,
LED_D,
LED_C,
LED_EMPTY,
LED_W,
LED_S,
LED_X,
LED_LGUI, LED_LGUI,
LED_X,
LED_S,
LED_W,
LED_LALT,
LED_Z,
LED_A,
LED_Q, LED_Q,
LED_A,
LED_Z,
LED_LALT,
LED_TAB,
LED_ESC,
LED_LSFT,
LED_LCTL, LED_LCTL,
LED_LSFT,
LED_ESC,
LED_TAB,
LED_TOTAL LED_TOTAL
}; };

View file

@ -14,6 +14,7 @@
#define PREVENT_STUCK_MODIFIERS #define PREVENT_STUCK_MODIFIERS
#define RGBSPS_ENABLE #define RGBSPS_ENABLE
#define RGBSPS_DEMO_ENABLE
#define UNICODE_TYPE_DELAY 0 #define UNICODE_TYPE_DELAY 0

View file

@ -144,6 +144,7 @@ enum planck_keycodes {
#ifndef MODULE_ADAFRUIT_BLE #ifndef MODULE_ADAFRUIT_BLE
OUT_BT, OUT_BT,
#endif #endif
RGBDEMO,
KEYCODE_END KEYCODE_END
}; };
@ -478,6 +479,27 @@ void led_turnoff_keys(void) {
} }
} }
#ifdef RGBSPS_DEMO_ENABLE
void led_demo(void) {
rgbsps_set(LED_IND_LINUX, 15, 15, 15);
rgbsps_set(LED_IND_APPLE, 15, 15, 15);
rgbsps_set(LED_IND_WINDOWS, 15, 15, 15);
rgbsps_set(LED_IND_QWERTY, 15, 10, 0);
rgbsps_set(LED_IND_ALT, 15, 10, 0);
rgbsps_set(LED_IND_AUDIO, 5, 11, 13);
rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15);
rgbsps_set(LED_IND_USB, 15, 15, 15);
rgbsps_set(LED_IND_CAPSLOCK, 15, 0, 0);
rgbsps_set(LED_IND_GUI, 15, 0, 15);
rgbsps_set(LED_IND_FUN, 15, 0, 0);
rgbsps_set(LED_IND_NUM, 0, 0, 15);
rgbsps_set(LED_IND_PUNC, 0, 15, 0);
rgbsps_set(LED_IND_GREEK, 0, 15, 15);
rgbsps_set(LED_IND_EMOJI, 15, 15, 0);
rgbsps_send();
}
#endif
void led_reset(void) { void led_reset(void) {
switch (glow_mode) { switch (glow_mode) {
case GLOW_NONE: case GLOW_NONE:
@ -634,11 +656,14 @@ void led_init(void) {
led_set_default_layer_indicator(); led_set_default_layer_indicator();
// clicky // clicky
#ifdef FAUXCLICKY_ENABLE
if (fauxclicky_enabled) { if (fauxclicky_enabled) {
rgbsps_set(LED_IND_AUDIO, 5, 11, 13); rgbsps_set(LED_IND_AUDIO, 5, 11, 13);
} else { } else {
rgbsps_set(LED_IND_AUDIO, 0, 0, 0); rgbsps_set(LED_IND_AUDIO, 0, 0, 0);
} }
#endif
rgbsps_send(); rgbsps_send();
} }
@ -919,7 +944,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_SYS] = KEYMAP( [_SYS] = KEYMAP(
DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, RGBDEMO,
XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BT, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BT, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
@ -1228,6 +1253,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true; return true;
break; break;
#endif #endif
#ifdef RGBSPS_DEMO_ENABLE
case RGBDEMO:
led_demo();
return false;
break;
#endif
} }
return true; return true;
} }

View file

@ -4,8 +4,8 @@
#include "matrix.h" #include "matrix.h"
#include "musical_notes.h" #include "musical_notes.h"
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_C5, 0.25); float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625);
float fauxclicky_released_note[2] = MUSICAL_NOTE(_C4, 0.25); float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625);
float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25); float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25);
// cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} // cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100}