From 3561787ccefccec1ac56a9b0a588171f75030746 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Apr 2026 23:37:28 +0000 Subject: [PATCH] Fix garbled OLED: send SSD1312 segment remap + charge pump via raw I2C The vial-qmk-corne-choc-pro OLED driver does not support OLED_IC_SSD1312, OLED_FLIP_SEGMENT, or configurable charge pump (only the vial-qmk-keebart driver has these features). The previous config defines were no-ops: OLED_IC_SSD1312 resolved to 0 (SSD1306), OLED_FLIP_SEGMENT was never checked, and OLED_CHARGE_PUMP_VALUE was ignored. The driver hardcodes SEGMENT_REMAP_INV (0xA1) and CHARGE_PUMP 0x14, but the SSD1312 needs SEGMENT_REMAP (0xA0) and 0x72 (9.0V). This caused the garbled/mirrored text visible on the display. Fix: Remove the no-op defines from config.h and send the correct SSD1312 init commands as raw I2C overrides in oled_post_init(). Agent-Logs-Url: https://github.com/timfee/qmk_userspace/sessions/9ba5d3f7-eb8a-4121-978b-870c8401995c Co-authored-by: timfee <3246342+timfee@users.noreply.github.com> --- users/timfee/config.h | 8 +++++--- users/timfee/timfee.c | 13 +++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/users/timfee/config.h b/users/timfee/config.h index 96d73f79..77c211ee 100644 --- a/users/timfee/config.h +++ b/users/timfee/config.h @@ -16,11 +16,13 @@ #define COMBO_ONLY_FROM_LAYER 0 // ── OLED (SSD1312 on Keebart Corne Choc Pro) ── -#define OLED_IC OLED_IC_SSD1312 +// Note: The vial-qmk-corne-choc-pro driver lacks SSD1312 support +// (no OLED_IC_SSD1312, OLED_FLIP_SEGMENT, or configurable charge pump). +// We set what the driver honors here; the SSD1312-specific fixups +// (segment remap + charge pump voltage) are sent via raw I2C commands +// in oled_post_init() inside timfee.c. #define OLED_DISPLAY_128X64 -#define OLED_FLIP_SEGMENT #define OLED_DISPLAY_ADDRESS 0x3C -#define OLED_CHARGE_PUMP_VALUE 0x72 #define OLED_BRIGHTNESS 64 #define OLED_TIMEOUT 0 #define OLED_TIMEOUT_USER 60000 diff --git a/users/timfee/timfee.c b/users/timfee/timfee.c index 27f9f7d4..cbfe7a2e 100644 --- a/users/timfee/timfee.c +++ b/users/timfee/timfee.c @@ -317,6 +317,19 @@ static bool oled_post_init(void) { pin_t pen = get_charge_pump_enable_pin(); gpio_write_pin_high(pen); wait_ms(20); + + // The vial-qmk-corne-choc-pro OLED driver does not support + // OLED_IC_SSD1312, OLED_FLIP_SEGMENT, or configurable charge pump. + // It hardcodes SEGMENT_REMAP_INV (0xA1) and CHARGE_PUMP 0x14, + // but the SSD1312 needs SEGMENT_REMAP (0xA0) and charge pump 0x72. + // Send the correct values as raw I2C commands after driver init. + static const uint8_t ssd1312_fixup[] = { + 0x00, // I2C command mode + 0xA0, // SEGMENT_REMAP: flip segment direction for SSD1312 + 0x8D, 0x72, // CHARGE_PUMP: 9.0 V for SSD1312 + }; + oled_send_cmd(ssd1312_fixup, sizeof(ssd1312_fixup)); + oled_clear(); g_user_ontime = timer_read32();