|
|
@ -12,6 +12,7 @@ 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 "bb-oled.h" |
|
|
|
<<<<<<< HEAD |
|
|
|
#include <string.h> |
|
|
|
// Grab the print function |
|
|
|
#ifdef ENCODER_ENABLE |
|
|
@ -20,6 +21,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
|
|
|
|
|
/* OLED |
|
|
|
* This contains general purpose oled code |
|
|
|
======= |
|
|
|
#ifdef ENCODER_ENABLE |
|
|
|
#include "bb-encoder.h" |
|
|
|
#endif |
|
|
|
/* ROTARY ENCODER |
|
|
|
* This contains my general rotary encoder code |
|
|
|
* Encoders each have a list of different modes they can be in. |
|
|
|
* Each mode also have an on click action as well. |
|
|
|
* Modes can be cycled using either shift-click or ctrl-click |
|
|
|
* Modes can be reset using OS click |
|
|
|
* Some modes are only accessible through some keymap layers |
|
|
|
>>>>>>> 1786b2a4f6 (Fixed kyria code to operational) |
|
|
|
*/ |
|
|
|
|
|
|
|
// Allow default to be overwritten by keymap if they return false |
|
|
@ -32,6 +45,7 @@ void oled_task_user(void) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
<<<<<<< HEAD |
|
|
|
/*-------------------------*\ |
|
|
|
|*---RENDERING FUNCTIONS---*| |
|
|
|
\*-------------------------*/ |
|
|
@ -45,6 +59,26 @@ void render_qmk_logo(uint8_t row, uint8_t col) { |
|
|
|
oled_set_cursor(col, row); |
|
|
|
oled_write_P(qmk_logo, false); |
|
|
|
} |
|
|
|
======= |
|
|
|
static void render_status(void) { |
|
|
|
// Function to print state information |
|
|
|
uint8_t this_layer = get_highest_layer(layer_state); |
|
|
|
uint8_t this_mod = get_mods(); |
|
|
|
// Temporary variable for RGB |
|
|
|
#if defined RGBLIGHT_ENABLE |
|
|
|
static char rgb_temp4[4] = {0}; |
|
|
|
#elif defined RGB_MATRIX_ENABLE |
|
|
|
static char rgb_temp4[4] = {0}; |
|
|
|
#endif |
|
|
|
// Temporary variable for WPM string |
|
|
|
#if defined WPM_ENABLE |
|
|
|
static char wpm_temp4[4] = {0}; |
|
|
|
#endif |
|
|
|
// Temporary variable for encoder state |
|
|
|
#if defined ENCODER_ENABLE |
|
|
|
static char encoder_temp6[6] = {0}; |
|
|
|
#endif |
|
|
|
>>>>>>> 1786b2a4f6 (Fixed kyria code to operational) |
|
|
|
|
|
|
|
void render_layer(uint8_t row, uint8_t col, uint8_t top_layer) { |
|
|
|
// Write the layer state |
|
|
@ -190,15 +224,50 @@ void render_status_lite(uint8_t row, uint8_t col) { |
|
|
|
// Show RGB mode as an overlay in media mode. |
|
|
|
# ifdef RGB_MATRIX_ENABLE |
|
|
|
case _MEDI: |
|
|
|
<<<<<<< HEAD |
|
|
|
render_rgb_lite(row + 1, col + 0); |
|
|
|
break; |
|
|
|
# endif // RGB_MATRIX_ENABLE |
|
|
|
======= |
|
|
|
oled_write_P(PSTR("m:"), false); |
|
|
|
itoa(rgblight_config.mode, rgb_temp4, 10); |
|
|
|
oled_write(rgb_temp4, false); |
|
|
|
oled_write_P(PSTR(" h:"), false); |
|
|
|
itoa(rgblight_config.hsv.h, rgb_temp4, 10); |
|
|
|
oled_write(rgb_temp4, false); |
|
|
|
oled_write_P(PSTR(" s:"), false); |
|
|
|
itoa(rgblight_config.hsv.s, rgb_temp4, 10); |
|
|
|
oled_write(rgb_temp4, false); |
|
|
|
oled_write_P(PSTR(" v:"), false); |
|
|
|
itoa(rgblight_config.hsv.v, rgb_temp4, 10); |
|
|
|
oled_write(rgb_temp4, false); |
|
|
|
oled_write_P(PSTR("\n"), false); |
|
|
|
break; |
|
|
|
#elif defined RGB_MATRIX_ENABLE |
|
|
|
case _MEDI: |
|
|
|
oled_write_P(PSTR("m"), false); |
|
|
|
itoa(rgb_matrix_config.mode, rgb_temp4, 10); |
|
|
|
oled_write(rgb_temp4, false); |
|
|
|
oled_write_P(PSTR(" h"), false); |
|
|
|
itoa(rgb_matrix_config.hsv.h, rgb_temp4, 10); |
|
|
|
oled_write(rgb_temp4, false); |
|
|
|
oled_write_P(PSTR(" s"), false); |
|
|
|
itoa(rgb_matrix_config.hsv.s, rgb_temp4, 10); |
|
|
|
oled_write(rgb_temp4, false); |
|
|
|
oled_write_P(PSTR(" v"), false); |
|
|
|
itoa(rgb_matrix_config.hsv.v, rgb_temp4, 10); |
|
|
|
oled_write(rgb_temp4, false); |
|
|
|
oled_write_P(PSTR("\n"), false); |
|
|
|
break; |
|
|
|
#endif |
|
|
|
>>>>>>> 1786b2a4f6 (Fixed kyria code to operational) |
|
|
|
// Show the modifier if nothing else is doing anything |
|
|
|
default: |
|
|
|
render_modifiers_lite(row + 1, col + 0, this_mod); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
<<<<<<< HEAD |
|
|
|
// Line 3: WPM and layout |
|
|
|
render_keymap(row + 2, col + 0, true); |
|
|
|
render_wpm(row + 2, col + 11); |
|
|
@ -208,6 +277,37 @@ void render_status_lite(uint8_t row, uint8_t col) { |
|
|
|
# ifdef SPLIT_KEYBOARD |
|
|
|
if (is_keyboard_left()) { |
|
|
|
render_encoder(row + 3, col + 0, 0, this_layer); |
|
|
|
======= |
|
|
|
// Line 3: WPM |
|
|
|
oled_write_P(PSTR("KM: Qwerty WPM: "), false); |
|
|
|
#if defined WPM_ENABLE |
|
|
|
itoa(get_current_wpm(), wpm_temp4, 10); |
|
|
|
oled_write(wpm_temp4, false); |
|
|
|
#else |
|
|
|
oled_write_P(PSTR("N/A"), false); |
|
|
|
#endif |
|
|
|
oled_write_P(PSTR("\n"), false); |
|
|
|
|
|
|
|
// Line 4: Encoder states |
|
|
|
#ifdef ENCODER_ENABLE |
|
|
|
oled_write_P(PSTR("EN0:"), false); |
|
|
|
encoder_state_string(0, this_layer, encoder_temp6); |
|
|
|
oled_write(encoder_temp6, false); |
|
|
|
oled_write_P(PSTR(" EN1:"), false); |
|
|
|
encoder_state_string(1, this_layer, encoder_temp6); |
|
|
|
oled_write(encoder_temp6, false); |
|
|
|
#endif |
|
|
|
oled_write_P(PSTR("\n"), false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void oled_task_user(void) { |
|
|
|
if (is_keyboard_master()) { |
|
|
|
#if defined(KEYBOARD_splitkb_kyria_rev1) |
|
|
|
render_qmk_logo(); |
|
|
|
#endif |
|
|
|
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) |
|
|
|
>>>>>>> 1786b2a4f6 (Fixed kyria code to operational) |
|
|
|
} else { |
|
|
|
render_encoder(row + 3, col + 0, 1, this_layer); |
|
|
|
} |
|
|
|