Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] add mlego/m65 oled revision #15833

Merged
merged 17 commits into from
Jan 30, 2022
Prev Previous commit
Next Next commit
add wpm
  • Loading branch information
alin m elena committed Jan 30, 2022
commit 08f5d8a1b879d5fca1fd1a7d25d3f3b790c9d741
6 changes: 6 additions & 0 deletions keyboards/mlego/m65/keymaps/uk/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#define UNICODE_SELECTED_MODES UC_LNX
//#define UNICODE_SELECTED_MODES UC_LNX, UC_MAC, UC_WINC

#ifdef WPM_ENABLE
#define WPM_SAMPLE_SECONDS 10
#define WPM_SAMPLE_PERIODS 100
#define WPM_ALLOW_COUNT_REGRESSION
#endif
9 changes: 7 additions & 2 deletions keyboards/mlego/m65/keymaps/uk/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ static void render_logo(void) {

void user_oled_magic(void) {
// Host Keyboard Layer Status
oled_write_P(PSTR("R1: Layer: "), false);
oled_write_P(PSTR("Layer: "), false);

switch (get_highest_layer(layer_state)) {
case _QW:
Expand All @@ -424,8 +424,13 @@ void user_oled_magic(void) {
// Host Keyboard LED Status
led_t led_state = host_keyboard_led_state();
oled_write_P(led_state.num_lock ? PSTR("Lower ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false);
oled_write_P(led_state.scroll_lock ? PSTR("Raise ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false);
#ifdef WPM_ENABLE
oled_write_P(PSTR("\nwpm: "), false);
uint8_t wpm = get_current_wpm();
oled_write_P(wpm != 0 ? get_u8_str(wpm,' ') : PSTR(" "), false);
#endif
}

oled_rotation_t oled_init_user(oled_rotation_t rotation) {
Expand Down
3 changes: 2 additions & 1 deletion keyboards/mlego/m65/rev4/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
ENCODER_ENABLE = yes # Enable encoder
OLED_ENABLE = yes # Enable OLED
OLED_DRIVER = SSD1306
OLED_DRIVER = SSD1306 # Enable Support for SSD1306 or SH1106 OLED Displays; Communicating over I2C
WPM_ENABLE = yes # Enable WPM Counter