Skip to content

Commit

Permalink
Tidy up LCD_ENABLE/visualizer references (#14855)
Browse files Browse the repository at this point in the history
* Tidy up LCD_ENABLE/visualizer references

* Fix up my (333fred) ergodox keymap with new LCD driver

Co-authored-by: Fredric Silberberg <fred@silberberg.xyz>
  • Loading branch information
zvecr and 333fred authored Oct 20, 2021
1 parent d4be4b6 commit 1816006
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 1,107 deletions.
4 changes: 0 additions & 4 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,6 @@ ifneq ($(strip $(VARIABLE_TRACE)),no)
endif
endif

ifeq ($(strip $(LCD_ENABLE)), yes)
CIE1931_CURVE := yes
endif

VALID_BACKLIGHT_TYPES := pwm timer software custom

BACKLIGHT_ENABLE ?= no
Expand Down
2 changes: 0 additions & 2 deletions keyboards/ergodox_infinity/keymaps/dudeofawesome/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@
#include "../../config.h"
#include "dudeofawesome.h"

#include "./visualizer.h"

#endif
4 changes: 2 additions & 2 deletions keyboards/ergodox_infinity/keymaps/dudeofawesome/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

void matrix_init_user() {
backlight_enable();
backlight_level(BACKLIGHT_LEVELS);
led_matrix_enable_noeeprom();
led_matrix_set_val_noeeprom(UINT8_MAX);
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
Expand Down
123 changes: 0 additions & 123 deletions keyboards/ergodox_infinity/keymaps/dudeofawesome/simple_visualizer.h

This file was deleted.

79 changes: 0 additions & 79 deletions keyboards/ergodox_infinity/keymaps/dudeofawesome/visualizer.c

This file was deleted.

35 changes: 0 additions & 35 deletions keyboards/ergodox_infinity/keymaps/dudeofawesome/visualizer.h

This file was deleted.

Loading

3 comments on commit 1816006

@AshtonO
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zvecr / @333fred Do you know if it's still possible to control the LCD screen on an ergodox_infinity after this commit? It seems like this commit simply removed it all together, but I'm not sure if there's some newer way I should be setting it up. If you do know how to do it after this commit, would you mind linking me to documentation/code pointers or providing a rough overview?

I tried reverting back to a commit before this but unfortunately am running into build problems on that commit.

@333fred
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is no, not until #10174 is merged.

@papey
Copy link

@papey papey commented on 1816006 Jan 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, here is what I ended with after some research :

#ifdef ST7565_ENABLE

const unsigned int LCD_MIN_ITENSITY = UINT16_MAX / 2;

void st7565_task_user(void) {
    st7565_clear();

    switch (get_highest_layer(layer_state)) {
        case L_0:
            // lpink 255,20,147
            ergodox_infinity_lcd_color(LCD_MIN_ITENSITY + 25500, LCD_MIN_ITENSITY + 9900, LCD_MIN_ITENSITY + 7100);
            st7565_write_P(PSTR("\n\n_\n"), false);
            break;
        case L_1:
            // blue 0,191,255
            ergodox_infinity_lcd_color(LCD_MIN_ITENSITY, LCD_MIN_ITENSITY + 19100, LCD_MIN_ITENSITY + 25500);
            st7565_write_P(PSTR("\n\nCode =~ Moves\n"), false);
            break;
        case L_2:
            // Green 50,205,50
            ergodox_infinity_lcd_color(LCD_MIN_ITENSITY + 5000, LCD_MIN_ITENSITY + 20500, LCD_MIN_ITENSITY + 5000);
            st7565_write_P(PSTR("\n\nFr Baguette Putain!\n"), false);
            break;
        case L_3:
            // pink 255,99,71
            ergodox_infinity_lcd_color(LCD_MIN_ITENSITY + 25500, LCD_MIN_ITENSITY + 2000, LCD_MIN_ITENSITY + 14700);
            st7565_write_P(PSTR("\n\n|> Media\n"), false);
            break;
        case L_4:
            ergodox_infinity_lcd_color(LCD_MIN_ITENSITY, LCD_MIN_ITENSITY, LCD_MIN_ITENSITY);
            st7565_write_P(PSTR("\n\n^ Gaming\n"), false);
            break;
    }
}

#endif

ergodox_infinity_lcd_color take a uint16 for r, g, b colors. After trial and errors, I found that minimum neutral intensity is nice around UINT16_MAX / 2, lets call it the default intensity.

When choosing a color start by using a standard RGB, eg pink r(255), g(99), b(71).

From that, mutiply all RGB values by 100 and add default intensity. This should give you some nice colors with sharped differences somewhat close to the RGB color you choose in the first place.

To set a text value, just use st7565_write_P(PSTR("TEXT"), false);

Hope it helps.

Please sign in to comment.