Closed h2zero closed 5 months ago
This appears to break I2C compatibility with the NRF52832. When attempting to compile for NRF52832, I get
[My sketch location.ino]: undefined reference to `Wire'
collect2.exe: error: ld returned 1 exit status
It isn't an issue with my sketch, as it compiles fine for NRF52832 with the previous Wire_nRF52.cpp
Works for NRF52810 though.
I'll see if I can figure out the problem. Thank you for this library and the fixes.
For whatever reason, changing line 402 in Wire_nRF52.cpp from
#if defined(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn)
to
#if defined(NRF_TWIM1)
fixed the issue. Now it works for both NRF52810 and NRF52832.
Thanks! I'll make some adjustments.
Looks good. I wonder if you also want to change line 411 in Wire_nRF52.cpp from
#if defined(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn)
to
#if defined(NRF_TWIM1)
given the previous issue with SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn
Done, this should work now.
Looks good. I wonder if you also want to change line 411 in Wire_nRF52.cpp from
#if defined(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn)
to#if defined(NRF_TWIM1)
given the previous issue withSPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn
Sorry I missed this comment, yes that seems better for sure at this moment as that doesn't look to actually be #defined
anywhere but is instead an enum value. For now I will use your suggestion but look to change it in the future if it no longer discriminates accurately enough.
Thanks for all the help!!!
@jackb60 Have you tested this with any devices connected to SPI/I2C? Would be great to know that its working as well as compiling 😄
Yes I have devices attached to both SPI and I2C and they are working (tested with NRF52810).
Perfect, I will merge this then. Thanks again!
Fixes #50, #52
@jackb60