Skip to content

Commit d9c5f2e

Browse files
authored
Merge pull request #635 from quietboil/improved
ssd1306: Allow SPI3 support to be disabled
2 parents eed96df + c3b7a01 commit d9c5f2e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

extras/ssd1306/component.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ INC_DIRS += $(ssd1306_ROOT)..
77
SSD1306_I2C_SUPPORT ?= 1
88
# SPI4 support is on by default
99
SSD1306_SPI4_SUPPORT ?= 1
10+
# SPI3 support is on by default
11+
SSD1306_SPI3_SUPPORT ?= 1
1012

1113
# args for passing into compile rule generation
1214
ssd1306_SRC_DIR = $(ssd1306_ROOT)
1315

14-
ssd1306_CFLAGS = -DSSD1306_I2C_SUPPORT=${SSD1306_I2C_SUPPORT} -DSSD1306_SPI4_SUPPORT=${SSD1306_SPI4_SUPPORT} $(CFLAGS)
16+
ssd1306_CFLAGS = -DSSD1306_I2C_SUPPORT=${SSD1306_I2C_SUPPORT} -DSSD1306_SPI4_SUPPORT=${SSD1306_SPI4_SUPPORT} -DSSD1306_SPI3_SUPPORT=${SSD1306_SPI3_SUPPORT} $(CFLAGS)
1517

1618

1719
$(eval $(call component_compile_rules,ssd1306))

extras/ssd1306/ssd1306.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ static int sh1106_go_coordinate(const ssd1306_t *dev, uint8_t x, uint8_t y)
236236
int ssd1306_load_frame_buffer(const ssd1306_t *dev, uint8_t buf[])
237237
{
238238
uint16_t i;
239+
#if (SSD1306_SPI3_SUPPORT)
239240
uint8_t j;
241+
#endif
240242
#if (SSD1306_I2C_SUPPORT)
241243
uint8_t tab[16] = { 0 };
242244
#endif

0 commit comments

Comments
 (0)