Remove old OLED API code (#21651)
This commit is contained in:
		
							parent
							
								
									f407d90598
								
							
						
					
					
						commit
						6018b56c55
					
				
					 28 changed files with 2 additions and 1017 deletions
				
			
		| 
						 | 
				
			
			@ -28,8 +28,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		|||
// #define MASTER_RIGHT
 | 
			
		||||
// #define EE_HANDS
 | 
			
		||||
 | 
			
		||||
#define SSD1306OLED
 | 
			
		||||
 | 
			
		||||
#define TAPPING_TERM 100
 | 
			
		||||
#undef TAPPING_TERM
 | 
			
		||||
#define TAPPING_TERM 150
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,9 +5,6 @@
 | 
			
		|||
  #include "lufa.h"
 | 
			
		||||
  #include "split_util.h"
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef SSD1306OLED
 | 
			
		||||
  #include "ssd1306.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef RGBLIGHT_ENABLE
 | 
			
		||||
//Following line allows macro to read current RGB settings
 | 
			
		||||
| 
						 | 
				
			
			@ -84,63 +81,9 @@ void matrix_init_user(void) {
 | 
			
		|||
    #ifdef RGBLIGHT_ENABLE
 | 
			
		||||
      RGB_current_mode = rgblight_config.mode;
 | 
			
		||||
    #endif
 | 
			
		||||
    //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
 | 
			
		||||
    #ifdef SSD1306OLED
 | 
			
		||||
        iota_gfx_init(!has_usb());   // turns on the display
 | 
			
		||||
    #endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
 | 
			
		||||
#ifdef SSD1306OLED
 | 
			
		||||
 | 
			
		||||
// When add source files to SRC in rules.mk, you can use functions.
 | 
			
		||||
const char *read_layer_state(void);
 | 
			
		||||
const char *read_logo(void);
 | 
			
		||||
void set_keylog(uint16_t keycode, keyrecord_t *record);
 | 
			
		||||
const char *read_keylog(void);
 | 
			
		||||
const char *read_keylogs(void);
 | 
			
		||||
 | 
			
		||||
void matrix_scan_user(void) {
 | 
			
		||||
   iota_gfx_task();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void matrix_render_user(struct CharacterMatrix *matrix) {
 | 
			
		||||
  if (is_master) {
 | 
			
		||||
    // If you want to change the display of OLED, you need to change here
 | 
			
		||||
    matrix_write_ln(matrix, read_layer_state());
 | 
			
		||||
    matrix_write_ln(matrix, read_keylog());
 | 
			
		||||
    matrix_write_ln(matrix, read_keylogs());
 | 
			
		||||
    //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui));
 | 
			
		||||
    //matrix_write_ln(matrix, read_host_led_state());
 | 
			
		||||
    //matrix_write_ln(matrix, read_timelog());
 | 
			
		||||
  } else {
 | 
			
		||||
    matrix_write(matrix, read_logo());
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) {
 | 
			
		||||
  if (memcmp(dest->display, source->display, sizeof(dest->display))) {
 | 
			
		||||
    memcpy(dest->display, source->display, sizeof(dest->display));
 | 
			
		||||
    dest->dirty = true;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void iota_gfx_task_user(void) {
 | 
			
		||||
  struct CharacterMatrix matrix;
 | 
			
		||||
  matrix_clear(&matrix);
 | 
			
		||||
  matrix_render_user(&matrix);
 | 
			
		||||
  matrix_update(&display, &matrix);
 | 
			
		||||
}
 | 
			
		||||
#endif//SSD1306OLED
 | 
			
		||||
 | 
			
		||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 | 
			
		||||
  if (record->event.pressed) {
 | 
			
		||||
#ifdef SSD1306OLED
 | 
			
		||||
    set_keylog(keycode, record);
 | 
			
		||||
#endif
 | 
			
		||||
    // set_timelog();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  switch (keycode) {
 | 
			
		||||
    case QWERTY:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue