How to use Arduino library while using Arduino as ESP-IDF component.
Posted: Thu Dec 19, 2019 2:00 pm
Hello.
This is my first post and I am not good at speaking English.
Please excuse.
Well, I want to use Arduino library while using Arduino as ESP-IDF component.
I want to use Adafruit-Fingerprint-Sensor-Library(https://github.com/adafruit/Adafruit-Fi ... or-Library)
I added the file(Adafruit-Fingerprint-Sensor-Library) to C:\msys32\home\user-name\esp\hello_world\components\arduino\libraries
and I edited CMakeLists.txt(C:\msys32\home\user-name\esp\hello_world\components\arduino)
↓
↓
Then I did "make flash" but it did not succeed.
Log :
Thank you for taking the time to read my post.
Please help me.
This is my first post and I am not good at speaking English.
Please excuse.
Well, I want to use Arduino library while using Arduino as ESP-IDF component.
I want to use Adafruit-Fingerprint-Sensor-Library(https://github.com/adafruit/Adafruit-Fi ... or-Library)
I added the file(Adafruit-Fingerprint-Sensor-Library) to C:\msys32\home\user-name\esp\hello_world\components\arduino\libraries
and I edited CMakeLists.txt(C:\msys32\home\user-name\esp\hello_world\components\arduino)
Code: Select all
set(LIBRARY_SRCS
libraries/ArduinoOTA/src/ArduinoOTA.cpp
Code: Select all
set(LIBRARY_SRCS
libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp
libraries/ArduinoOTA/src/ArduinoOTA.cpp
Code: Select all
set(COMPONENT_ADD_INCLUDEDIRS
variants/esp32/
cores/esp32/
libraries/ArduinoOTA/src
Code: Select all
set(COMPONENT_ADD_INCLUDEDIRS
variants/esp32/
cores/esp32/
libraries/Adafruit-Fingerprint-Sensor-Library
libraries/ArduinoOTA/src
Log :
Code: Select all
CXX build/arduino/libraries/Adafruit-Fingerprint-Sensor-Library//Adafruit_Fingerprint.o
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp: In member function 'uint8_t Adafruit_Fingerprint::setPassword(uint32_t)':
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:265:54: error: narrowing conversion of '(password >> 24)' from 'uint32_t {aka unsigned int}' to 'uint8_t {aka unsigned char}' inside { } [-Werror=narrowing]
SEND_CMD_PACKET(FINGERPRINT_SETPASSWORD, (password >> 24), (password >> 16), (password >> 8), password);
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:30:21: note: in definition of macro 'GET_CMD_PACKET'
uint8_t data[] = {__VA_ARGS__}; \
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:265:3: note: in expansion of macro 'SEND_CMD_PACKET'
SEND_CMD_PACKET(FINGERPRINT_SETPASSWORD, (password >> 24), (password >> 16), (password >> 8), password);
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:265:72: error: narrowing conversion of '(password >> 16)' from 'uint32_t {aka unsigned int}' to 'uint8_t {aka unsigned char}' inside { } [-Werror=narrowing]
SEND_CMD_PACKET(FINGERPRINT_SETPASSWORD, (password >> 24), (password >> 16), (password >> 8), password);
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:30:21: note: in definition of macro 'GET_CMD_PACKET'
uint8_t data[] = {__VA_ARGS__}; \
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:265:3: note: in expansion of macro 'SEND_CMD_PACKET'
SEND_CMD_PACKET(FINGERPRINT_SETPASSWORD, (password >> 24), (password >> 16), (password >> 8), password);
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:265:90: error: narrowing conversion of '(password >> 8)' from 'uint32_t {aka unsigned int}' to 'uint8_t {aka unsigned char}' inside { } [-Werror=narrowing]
SEND_CMD_PACKET(FINGERPRINT_SETPASSWORD, (password >> 24), (password >> 16), (password >> 8), password);
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:30:21: note: in definition of macro 'GET_CMD_PACKET'
uint8_t data[] = {__VA_ARGS__}; \
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:265:3: note: in expansion of macro 'SEND_CMD_PACKET'
SEND_CMD_PACKET(FINGERPRINT_SETPASSWORD, (password >> 24), (password >> 16), (password >> 8), password);
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:30:32: error: narrowing conversion of 'password' from 'uint32_t {aka unsigned int}' to 'uint8_t {aka unsigned char}' inside { } [-Werror=narrowing]
uint8_t data[] = {__VA_ARGS__}; \
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:36:30: note: in expansion of macro 'GET_CMD_PACKET'
#define SEND_CMD_PACKET(...) GET_CMD_PACKET(__VA_ARGS__); return packet.data[0];
^
C:/msys32/home/user-name/esp/hello_world/components/arduino/libraries/Adafruit-Fingerprint-Sensor-Library/Adafruit_Fingerprint.cpp:265:3: note: in expansion of macro 'SEND_CMD_PACKET'
SEND_CMD_PACKET(FINGERPRINT_SETPASSWORD, (password >> 24), (password >> 16), (password >> 8), password);
^
cc1plus.exe: some warnings being treated as errors
make[1]: *** [/home/user-name/esp/esp-idf/make/component_wrapper.mk:290: libraries/Adafruit-Fingerprint-Sensor-Library//Adafruit_Fingerprint.o] error 1
make: *** [C:/msys32/home/user-name/esp/esp-idf/make/project.mk:552: component-arduino-build] error 2
Please help me.