diff options
author | Richard <rich@brickbots.com> | 2020-08-24 07:40:45 -0700 |
---|---|---|
committer | James Young <18669334+noroadsleft@users.noreply.github.com> | 2020-08-29 14:30:02 -0700 |
commit | fa6cf8572736f16d2fe076c21546d08f258e145f (patch) | |
tree | 55809744c500176384f0550c9c2db629979a1d9f /drivers/oled/oled_driver.c | |
parent | 92385b3fb617326b129609726020453c8949c7f8 (diff) | |
download | qmk_firmware-fa6cf8572736f16d2fe076c21546d08f258e145f.tar.gz |
Add a method to read the OLED display buffer from user space (#8777)
* Adding extern and declaration
* Change to mediated buffer read
* Adding raw byte read
* Restore write raw... D'Oh
* Working struct return
* Pack that struct
* Remove conditional packing and add example to docs
* Cleanup tab/spaces
* Update docs/feature_oled_driver.md
Prettify formatting
* Update drivers/oled/oled_driver.h
Prettify formatting
Diffstat (limited to 'drivers/oled/oled_driver.c')
-rw-r--r-- | drivers/oled/oled_driver.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c index f1990567f..bbf010a09 100644 --- a/drivers/oled/oled_driver.c +++ b/drivers/oled/oled_driver.c @@ -444,6 +444,14 @@ void oled_pan(bool left) { oled_dirty = ~((OLED_BLOCK_TYPE)0); } +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; + ret_reader.current_element = &oled_buffer[start_index]; + ret_reader.remaining_element_count = OLED_MATRIX_SIZE - start_index; + return ret_reader; +} + void oled_write_raw_byte(const char data, uint16_t index) { if (index > OLED_MATRIX_SIZE) index = OLED_MATRIX_SIZE; if (oled_buffer[index] == data) return; |