diff --git a/cores/nRF5/wiring_analog_nRF52.c b/cores/nRF5/wiring_analog_nRF52.c index b4d9de2d..28afc210 100644 --- a/cores/nRF5/wiring_analog_nRF52.c +++ b/cores/nRF5/wiring_analog_nRF52.c @@ -31,7 +31,7 @@ extern "C" { static uint32_t saadcReference = SAADC_CH_CONFIG_REFSEL_Internal; static uint32_t saadcGain = SAADC_CH_CONFIG_GAIN_Gain1_6; -#if 0 +#if 0 // Note: Adafruit use seperated HardwarePWM class #define PWM_COUNT 3 static NRF_PWM_Type* pwms[PWM_COUNT] = { diff --git a/libraries/SPI/SPI.cpp b/libraries/SPI/SPI.cpp index 6ae78541..fc82d73e 100644 --- a/libraries/SPI/SPI.cpp +++ b/libraries/SPI/SPI.cpp @@ -248,3 +248,6 @@ void SPIClass::detachInterrupt() { #if SPI_INTERFACES_COUNT > 0 SPIClass SPI (NRF_SPI0, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI); #endif +#if SPI_INTERFACES_COUNT > 1 +SPIClass SPI1(NRF_SPI1, PIN_SPI1_MISO, PIN_SPI1_SCK, PIN_SPI1_MOSI); +#endif diff --git a/libraries/Wire/Wire.h b/libraries/Wire/Wire.h index 22d34041..412ec588 100755 --- a/libraries/Wire/Wire.h +++ b/libraries/Wire/Wire.h @@ -28,9 +28,7 @@ #include "RingBuffer.h" -#define BUFFER_LENGTH 32 - - // WIRE_HAS_END means Wire has end() +// WIRE_HAS_END means Wire has end() #define WIRE_HAS_END 1 class TwoWire : public Stream @@ -39,7 +37,7 @@ class TwoWire : public Stream #ifdef NRF52 TwoWire(NRF_TWIM_Type * p_twim, NRF_TWIS_Type * p_twis, IRQn_Type IRQn, uint8_t pinSDA, uint8_t pinSCL); #else - TwoWire(NRF_TWI_Type * p_twi, IRQn_Type IRQn, uint8_t pinSDA, uint8_t pinSCL); + TwoWire(NRF_TWI_Type * p_twi, uint8_t pinSDA, uint8_t pinSCL); #endif void begin(); #ifdef NRF52 @@ -65,12 +63,11 @@ class TwoWire : public Stream #ifdef NRF52 void onReceive(void(*)(int)); void onRequest(void(*)(void)); + void onService(void); #endif using Print::write; - void onService(void); - private: #ifdef NRF52 NRF_TWIM_Type * _p_twim; @@ -87,11 +84,12 @@ class TwoWire : public Stream bool master; bool receiving; bool transmissionBegun; + bool suspended; // RX Buffer RingBuffer rxBuffer; - //TX buffer + // TX buffer RingBuffer txBuffer; uint8_t txAddress;