From 6a1f431babf308821cc196489181231fec8ad269 Mon Sep 17 00:00:00 2001 From: maro159 Date: Tue, 5 Dec 2023 22:41:42 +0100 Subject: [PATCH 1/2] add function clear_square Add function ssd1306_clear_square() which may be used to optimize display routines ex. to change only a single line of text --- ssd1306.c | 7 ++++++- ssd1306.h | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ssd1306.c b/ssd1306.c index f57975e..1ce7d9d 100644 --- a/ssd1306.c +++ b/ssd1306.c @@ -174,11 +174,16 @@ void ssd1306_draw_line(ssd1306_t *p, int32_t x1, int32_t y1, int32_t x2, int32_t } } +void ssd1306_clear_square(ssd1306_t *p, uint32_t x, uint32_t y, uint32_t width, uint32_t height) { + for(uint32_t i=0; i Date: Tue, 5 Dec 2023 22:42:03 +0100 Subject: [PATCH 2/2] fix typo --- ssd1306.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssd1306.h b/ssd1306.h index 03e7fae..138cef3 100644 --- a/ssd1306.h +++ b/ssd1306.h @@ -162,7 +162,7 @@ void ssd1306_clear_pixel(ssd1306_t *p, uint32_t x, uint32_t y); void ssd1306_draw_pixel(ssd1306_t *p, uint32_t x, uint32_t y); /** - @brief draw pixel on buffer + @brief draw line on buffer @param[in] p : instance of display @param[in] x1 : x position of starting point