summaryrefslogtreecommitdiff
path: root/users/drashna/oled/sh110x.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2022-05-30 22:02:55 -0700
committerGitHub <noreply@github.com>2022-05-30 22:02:55 -0700
commitcda343acbe45826225edac75eaa63216bf76d874 (patch)
tree398a14c907baa8e6521fc9d001a4619289e1d7a3 /users/drashna/oled/sh110x.c
parentb554e4b612d24109ce714554a306043a01382cbd (diff)
[Keymap] Drashna update for post Q2 merge (#17241)
Diffstat (limited to 'users/drashna/oled/sh110x.c')
-rw-r--r--users/drashna/oled/sh110x.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/users/drashna/oled/sh110x.c b/users/drashna/oled/sh110x.c
index cfdae1db16..aa081ca732 100644
--- a/users/drashna/oled/sh110x.c
+++ b/users/drashna/oled/sh110x.c
@@ -521,6 +521,25 @@ void oled_pan(bool left) {
oled_dirty = OLED_ALL_BLOCKS_MASK;
}
+void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_start, uint16_t x_end) {
+ uint16_t i = 0;
+ for (uint16_t y = y_start; y < y_end; y++) {
+ if (left) {
+ for (uint16_t x = x_start; x < x_end - 1; x++) {
+ i = y * OLED_DISPLAY_WIDTH + x;
+ oled_buffer[i] = oled_buffer[i + 1];
+ oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE));
+ }
+ } else {
+ for (uint16_t x = x_end - 1; x > 0; x--) {
+ i = y * OLED_DISPLAY_WIDTH + x;
+ oled_buffer[i] = oled_buffer[i - 1];
+ oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE));
+ }
+ }
+ }
+}
+
oled_buffer_reader_t oled_read_raw(uint16_t start_index) {
if (start_index > OLED_MATRIX_SIZE) start_index = OLED_MATRIX_SIZE;
oled_buffer_reader_t ret_reader;