From f7b7cf9e80200cade938d47527e39034c75b9b6d Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Thu, 18 Jun 2020 10:07:21 +0100 Subject: rudimentary clipping --- Makefile.include | 4 ++-- app/oled.c | 11 +++++++++++ doc/cs32g103.pdf | Bin 0 -> 3091285 bytes 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 doc/cs32g103.pdf diff --git a/Makefile.include b/Makefile.include index e33adb3..636c314 100644 --- a/Makefile.include +++ b/Makefile.include @@ -29,8 +29,8 @@ ARCH_FLAGS = -mthumb -mcpu=cortex-m3 $(FP_FLAGS) -mfix-cortex-m3-ldrd OOCD ?= openocd OOCD_INTERFACE ?= interface/stlink-v2.cfg -OOCD_BOARD = ../target/stm32f103.cfg -#OOCD_BOARD ?= target/stm32f1x.cfg +#OOCD_BOARD = ../target/stm32f103.cfg +OOCD_BOARD ?= target/stm32f1x.cfg ################################################################################ # Black Magic Probe specific variables diff --git a/app/oled.c b/app/oled.c index e5edfed..63a47fc 100644 --- a/app/oled.c +++ b/app/oled.c @@ -148,6 +148,17 @@ oled_blit_strip (uint8_t *vram, int x, int xe, uint8_t mask, int shift, { uint8_t r, s; + while (x < 0) { + x++; + src++; + }; + + if (xe < 0) xe = 0; + + if (x > SSD1306_VRAM_SIZE) xe = SSD1306_VRAM_SIZE; + + if (xe > SSD1306_VRAM_SIZE) xe = SSD1306_VRAM_SIZE; + if (shift > 0) { for (x++; x <= xe; ++x) { diff --git a/doc/cs32g103.pdf b/doc/cs32g103.pdf new file mode 100644 index 0000000..a4d994b Binary files /dev/null and b/doc/cs32g103.pdf differ -- cgit v1.2.3