-
-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Labels
Description
Describe the bug
When I try to build this as an Espressif component in my project, I get two errors regarding:
- Not finding
#include "driver/gpio.h"
portTICK_RATE_MS
inesp/platform.c
not being defined
To Reproduce
Steps to reproduce the behavior:
- Create platformio project
- Clone ssd1306 project into components/
- Build
- See error regarding driver/gpio.h
- Fix this (as described below)
- See error regarding portTICK_RATE_MS
Expected behavior
No build errors.
Error Messages
regarding driver/gpio.h:
Building in release mode
Compiling .pio/build/lolin_d32_pro/components/ssd1306/src/ssd1306_hal/esp/platform.c.o
components/ssd1306/src/ssd1306_hal/esp/platform.c:33:10: fatal error: driver/gpio.h: No such file or directory
33 | #include "driver/gpio.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
*** [.pio/build/lolin_d32_pro/components/ssd1306/src/ssd1306_hal/esp/platform.c.o] Error 1
================== [FAILED] Took 5.59 seconds ==================
regarding portTICK_RATE_MS:
Building in release mode
Compiling .pio/build/lolin_d32_pro/components/ssd1306/src/ssd1306_hal/esp/platform.c.o
components/ssd1306/src/ssd1306_hal/esp/platform.c: In function 'platform_i2c_stop':
components/ssd1306/src/ssd1306_hal/esp/platform.c:103:77: error: 'portTICK_RATE_MS' undeclared (first use in this function); did you mean 'portTICK_PERIOD_MS'?
103 | /*esp_err_t ret =*/ i2c_master_cmd_begin(s_bus_id, s_cmd_handle, 1000 / portTICK_RATE_MS);
| ^~~~~~~~~~~~~~~~
| portTICK_PERIOD_MS
components/ssd1306/src/ssd1306_hal/esp/platform.c:103:77: note: each undeclared identifier is reported only once for each function it appears in
*** [.pio/build/lolin_d32_pro/components/ssd1306/src/ssd1306_hal/esp/platform.c.o] Error 1
================================ [FAILED] Took 5.86 seconds ================================
Please complete the following information:
- library version: 1.8.5
- LCD display type
- OS: linux
- Platform: platformio : esp32
- IDE: VSCode
Suggested fixes
The errors can be fixed by making the following edits:
In CMakeLists.txt
change
idf_component_register(SRCS ${SOURCE_FILES}
INCLUDE_DIRS "src")
to
idf_component_register(SRCS ${SOURCE_FILES}
INCLUDE_DIRS "src"
REQUIRES driver)
In /esp/platform.c
change portTICK_RATE_MS
to portTICK_PERIOD_MS
.