sumotoy / gpio_expander

A library for drive a lot of GPIO chips with Arduino/Teensy3.x or LC
69 stars 29 forks source link

Undeclared NOT_AN_INTERRUPT for Nordic NRF52 plateform #14

Open PJCzx opened 4 years ago

PJCzx commented 4 years ago

Hello @sumotoy

Thx for your work :)

I submitted a fix for relative path of Wire.h and SPI.h headers. This enables me to build correctly on atmelavr plateform but still have an issue on nordicnrf52.

Environment    Status    Duration
-------------  --------  ------------
nanoatmega328  SUCCESS   00:00:03.300
nordicnrf52    FAILED    00:00:02.831

Here are my project confs :

[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328
framework = arduino
lib_deps =
    Wire
    SPI
    gpio_expander

[env:nordicnrf52]
lib_deps =
    Wire
    SPI
    gpio_expander
framework = arduino
platform = nordicnrf52
board = nrf52_dk
debug_tool = jlink

And here is the error part of my console output 👍

.pio/libdeps/nordicnrf52/gpio_expander_ID973/max6957.cpp: In member function 'int max6957::getInterruptNumber(byte)':
.pio/libdeps/nordicnrf52/gpio_expander_ID973/max6957.cpp:49:16: error: 'NOT_AN_INTERRUPT' was not declared in this scope
  if (intNum != NOT_AN_INTERRUPT) {
                ^~~~~~~~~~~~~~~~
Compiling .pio/build/nordicnrf52/lib499/gpio_expander_ID973/mcp23016.cpp.o
.pio/libdeps/nordicnrf52/gpio_expander_ID973/max6957.cpp:49:16: note: suggested alternative: '_WIRING_INTERRUPTS_'
  if (intNum != NOT_AN_INTERRUPT) {
                ^~~~~~~~~~~~~~~~
                _WIRING_INTERRUPTS_
Archiving .pio/build/nordicnrf52/liba99/libSPI.a
.pio/libdeps/nordicnrf52/gpio_expander_ID973/max7301.cpp: In member function 'int max7301::getInterruptNumber(byte)':
.pio/libdeps/nordicnrf52/gpio_expander_ID973/max7301.cpp:48:16: error: 'NOT_AN_INTERRUPT' was not declared in this scope
  if (intNum != NOT_AN_INTERRUPT) {
                ^~~~~~~~~~~~~~~~
*** [.pio/build/nordicnrf52/lib499/gpio_expander_ID973/max6957.cpp.o] Error 1
.pio/libdeps/nordicnrf52/gpio_expander_ID973/max7301.cpp:48:16: note: suggested alternative: '_WIRING_INTERRUPTS_'
  if (intNum != NOT_AN_INTERRUPT) {
                ^~~~~~~~~~~~~~~~
                _WIRING_INTERRUPTS_
Indexing .pio/build/nordicnrf52/liba99/libSPI.a
*** [.pio/build/nordicnrf52/lib499/gpio_expander_ID973/max7301.cpp.o] Error 1

Do you have any clue ?

Thx a lot :)

PJCzx commented 4 years ago

I suggested a fix here : https://github.com/sumotoy/gpio_expander/pull/15

PLEASE REVIEW CAREFULLY since it may be a bit rought ^^

Thx