SuperHouse / esp-open-rtos

Open source FreeRTOS-based ESP8266 software framework
BSD 3-Clause "New" or "Revised" License
1.52k stars 491 forks source link

ssd1306: Allow SPI3 support to be disabled #635

Closed quietboil closed 6 years ago

quietboil commented 6 years ago

At the moment SPI3, unlike SPI4 or I2C, cannot be disabled and the driver always includes SPI3 protocol code. This change allows a program to exclude SPI3 if it is not needed.

For example, when only SPI4 is needed, a program would set these variables in the Makefile:

EXTRA_COMPONENTS = extras/ssd1306
SSD1306_SPI4_SUPPORT = 1
SSD1306_SPI3_SUPPORT = 0
SSD1306_I2C_SUPPORT = 0

PROGRAM_CFLAGS = $(ssd1306_CFLAGS)

The change in ssd1306.c is to suppress "unused variable" warning as j is used only by SPI3.

UncleRus commented 6 years ago

Thank you!