aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oled
diff options
context:
space:
mode:
authorQMK Bot2025-11-30 20:25:52 +0100
committerQMK Bot2025-11-30 20:25:52 +0100
commitee60542bd6aa8d96714516f7f42b02fbd8105fcb (patch)
treefacebc35a70d8890375388f963f05ec4c89a9369 /drivers/oled
parentb5dfb2bd1ea38a37c58227eb17bde583f0c0e4d6 (diff)
parent6ed61c65dd66cdbb450a4920a69bae193ec73f15 (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'drivers/oled')
-rw-r--r--drivers/oled/oled_driver.c14
-rw-r--r--drivers/oled/oled_driver.h36
2 files changed, 16 insertions, 34 deletions
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c
index 7e46bcb3f7..a7a78bf3c1 100644
--- a/drivers/oled/oled_driver.c
+++ b/drivers/oled/oled_driver.c
@@ -146,7 +146,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// parts of the display unusable or don't get cleared correctly
// and also allows for drawing & inverting
uint8_t oled_buffer[OLED_MATRIX_SIZE];
-uint8_t * oled_cursor;
+uint8_t *oled_cursor;
OLED_BLOCK_TYPE oled_dirty = 0;
bool oled_initialized = false;
bool oled_active = false;
@@ -301,24 +301,18 @@ bool oled_init(oled_rotation_t rotation) {
oled_driver_init();
static const uint8_t PROGMEM display_setup1[] = {
- I2C_CMD,
- DISPLAY_OFF,
- DISPLAY_CLOCK,
- OLED_DISPLAY_CLOCK,
- MULTIPLEX_RATIO,
+ I2C_CMD, DISPLAY_OFF, DISPLAY_CLOCK, OLED_DISPLAY_CLOCK, MULTIPLEX_RATIO,
#if OLED_IC_COM_PINS_ARE_COLUMNS
OLED_DISPLAY_WIDTH - 1,
#else
OLED_DISPLAY_HEIGHT - 1,
#endif
#if OLED_IC == OLED_IC_SH1107
- SH1107_DISPLAY_START_LINE,
- 0x00,
+ SH1107_DISPLAY_START_LINE, 0x00,
#else
DISPLAY_START_LINE | 0x00,
#endif
- CHARGE_PUMP,
- 0x14,
+ CHARGE_PUMP, 0x14,
#if OLED_IC_HAS_HORIZONTAL_MODE
// MEMORY_MODE is unsupported on SH1106 (Page Addressing only)
MEMORY_MODE,
diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h
index c3db7e6d97..36fe8c195c 100644
--- a/drivers/oled/oled_driver.h
+++ b/drivers/oled/oled_driver.h
@@ -53,12 +53,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
# ifndef OLED_SOURCE_MAP
-# define OLED_SOURCE_MAP \
- { 0, 8, 16, 24, 32, 40, 48, 56 }
+# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
# endif
# ifndef OLED_TARGET_MAP
-# define OLED_TARGET_MAP \
- { 56, 48, 40, 32, 24, 16, 8, 0 }
+# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
# endif
// If OLED_BLOCK_TYPE is uint32_t, these tables would look like:
// #define OLED_SOURCE_MAP { 32, 40, 48, 56 }
@@ -97,12 +95,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# endif
# ifndef OLED_SOURCE_MAP
-# define OLED_SOURCE_MAP \
- { 0, 8, 16, 24 }
+# define OLED_SOURCE_MAP {0, 8, 16, 24}
# endif
# ifndef OLED_TARGET_MAP
-# define OLED_TARGET_MAP \
- { 24, 16, 8, 0 }
+# define OLED_TARGET_MAP {24, 16, 8, 0}
# endif
#elif defined(OLED_DISPLAY_64X48)
@@ -132,12 +128,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# endif
# ifndef OLED_SOURCE_MAP
-# define OLED_SOURCE_MAP \
- { 0, 8 }
+# define OLED_SOURCE_MAP {0, 8}
# endif
# ifndef OLED_TARGET_MAP
-# define OLED_TARGET_MAP \
- { 8, 0 }
+# define OLED_TARGET_MAP {8, 0}
# endif
#elif defined(OLED_DISPLAY_64X128)
@@ -170,12 +164,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# endif
# ifndef OLED_SOURCE_MAP
-# define OLED_SOURCE_MAP \
- { 0, 8, 16, 24, 32, 40, 48, 56 }
+# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
# endif
# ifndef OLED_TARGET_MAP
-# define OLED_TARGET_MAP \
- { 56, 48, 40, 32, 24, 16, 8, 0 }
+# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
# endif
#elif defined(OLED_DISPLAY_128X128)
@@ -208,12 +200,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
# ifndef OLED_SOURCE_MAP
-# define OLED_SOURCE_MAP \
- { 0, 8, 16, 24, 32, 40, 48, 56 }
+# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
# endif
# ifndef OLED_TARGET_MAP
-# define OLED_TARGET_MAP \
- { 56, 48, 40, 32, 24, 16, 8, 0 }
+# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
# endif
#else // defined(OLED_DISPLAY_128X64)
// Default 128x32
@@ -242,12 +232,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
# ifndef OLED_SOURCE_MAP
-# define OLED_SOURCE_MAP \
- { 0, 8, 16, 24 }
+# define OLED_SOURCE_MAP {0, 8, 16, 24}
# endif
# ifndef OLED_TARGET_MAP
-# define OLED_TARGET_MAP \
- { 24, 16, 8, 0 }
+# define OLED_TARGET_MAP {24, 16, 8, 0}
# endif
// If OLED_BLOCK_TYPE is uint8_t, these tables would look like:
// #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }