[Keymap] Drashna's Cleanup and RGB Divide (#8506)

* Enable External EEPROM on Planck Rev6

* Update KC_MAKE macro to use qmk cli util

* Disable additional gradients for rgb matrix

* Update analog code for newer methods

* Update ergodox layout

* Disable Grave Escape

* Cleanup OLED code a bit

* Remove old unicode code

* Seperate RGB Matrix code from RGB Light code in userspace

* Massive overhaul an generalization of personal OLED code

Now lets hope I NEVER get a keyboard using a 128x32 in a normal orientation.

* Super tiny cleanup

* Enable Diablo layer on kyria

* clang format pass

* Additional OLED cleanup
This commit is contained in:
Drashna Jaelre
2020-03-31 16:26:43 -07:00
committed by GitHub
parent 8c80475fcc
commit c67e304593
22 changed files with 890 additions and 869 deletions

View File

@ -18,12 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "drashna.h"
userspace_config_t userspace_config;
#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
# define DRASHNA_UNICODE_MODE UC_WIN
#else
// set to 2 for UC_WIN, set to 4 for UC_WINC
# define DRASHNA_UNICODE_MODE 2
#endif
bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) {
static uint16_t this_timer;
@ -93,19 +87,17 @@ void matrix_init_user(void) {
DDRB &= ~(1 << 0);
PORTB &= ~(1 << 0);
#endif
#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
set_unicode_input_mode(DRASHNA_UNICODE_MODE);
get_unicode_input_mode();
#endif // UNICODE_ENABLE
matrix_init_keymap();
}
__attribute__((weak)) void keyboard_post_init_keymap(void) {}
void keyboard_post_init_user(void) {
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
keyboard_post_init_rgb();
#if defined(RGBLIGHT_ENABLE)
keyboard_post_init_rgb_light();
#endif
#if defined(RGB_MATRIX_ENABLE)
keyboard_post_init_rgb_matrix();
#endif
keyboard_post_init_keymap();
}
@ -155,9 +147,12 @@ void matrix_scan_user(void) {
run_diablo_macro_check();
#endif // TAP_DANCE_ENABLE
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
matrix_scan_rgb();
#if defined(RGBLIGHT_ENABLE)
matrix_scan_rgb_light();
#endif // RGBLIGHT_ENABLE
#if defined(RGB_MATRIX_ENABLE)
matrix_scan_rgb_matrix();
#endif
matrix_scan_keymap();
}
@ -168,8 +163,8 @@ __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state)
// Then runs keymap's layer change check
layer_state_t layer_state_set_user(layer_state_t state) {
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
state = layer_state_set_rgb(state);
#if defined(RGBLIGHT_ENABLE)
state = layer_state_set_rgb_light(state);
#endif // RGBLIGHT_ENABLE
return layer_state_set_keymap(state);
}
@ -200,12 +195,6 @@ void eeconfig_init_user(void) {
userspace_config.raw = 0;
userspace_config.rgb_layer_change = true;
eeconfig_update_user(userspace_config.raw);
#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
set_unicode_input_mode(DRASHNA_UNICODE_MODE);
get_unicode_input_mode();
#else
eeprom_update_byte(EECONFIG_UNICODEMODE, DRASHNA_UNICODE_MODE);
#endif
eeconfig_init_keymap();
keyboard_init();
}