Skip to content

Commit bd6beba

Browse files
committed
Remove unused interrupt from Wire lib
1 parent 8747fa2 commit bd6beba

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

libraries/Wire/Wire.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TwoWire : public Stream
3939
#ifdef NRF52
4040
TwoWire(NRF_TWIM_Type * p_twim, NRF_TWIS_Type * p_twis, IRQn_Type IRQn, uint8_t pinSDA, uint8_t pinSCL);
4141
#else
42-
TwoWire(NRF_TWI_Type * p_twi, IRQn_Type IRQn, uint8_t pinSDA, uint8_t pinSCL);
42+
TwoWire(NRF_TWI_Type * p_twi, uint8_t pinSDA, uint8_t pinSCL);
4343
#endif
4444
void begin();
4545
#ifdef NRF52
@@ -65,12 +65,11 @@ class TwoWire : public Stream
6565
#ifdef NRF52
6666
void onReceive(void(*)(int));
6767
void onRequest(void(*)(void));
68+
void onService(void);
6869
#endif
6970

7071
using Print::write;
7172

72-
void onService(void);
73-
7473
private:
7574
#ifdef NRF52
7675
NRF_TWIM_Type * _p_twim;

libraries/Wire/Wire_nRF51.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ extern "C" {
3030

3131
#include "Wire.h"
3232

33-
TwoWire::TwoWire(NRF_TWI_Type * p_twi, IRQn_Type IRQn, uint8_t pinSDA, uint8_t pinSCL)
33+
TwoWire::TwoWire(NRF_TWI_Type * p_twi, uint8_t pinSDA, uint8_t pinSCL)
3434
{
3535
this->_p_twi = p_twi;
36-
this->_IRQn = IRQn;
3736
this->_uc_pinSDA = g_ADigitalPinMap[pinSDA];
3837
this->_uc_pinSCL = g_ADigitalPinMap[pinSCL];
3938
transmissionBegun = false;
@@ -59,10 +58,6 @@ void TwoWire::begin(void) {
5958
_p_twi->ENABLE = (TWI_ENABLE_ENABLE_Enabled << TWI_ENABLE_ENABLE_Pos);
6059
_p_twi->PSELSCL = _uc_pinSCL;
6160
_p_twi->PSELSDA = _uc_pinSDA;
62-
63-
NVIC_ClearPendingIRQ(_IRQn);
64-
NVIC_SetPriority(_IRQn, 2);
65-
NVIC_EnableIRQ(_IRQn);
6661
}
6762

6863
void TwoWire::setClock(uint32_t baudrate) {
@@ -277,20 +272,8 @@ void TwoWire::flush(void)
277272
// data transfer.
278273
}
279274

280-
void TwoWire::onService(void)
281-
{
282-
}
283-
284275
#if WIRE_INTERFACES_COUNT > 0
285-
TwoWire Wire(NRF_TWI1, SPI1_TWI1_IRQn, PIN_WIRE_SDA, PIN_WIRE_SCL);
286-
287-
extern "C"
288-
{
289-
void SPI1_TWI1_IRQHandler(void)
290-
{
291-
Wire.onService();
292-
}
293-
}
276+
TwoWire Wire(NRF_TWI1, PIN_WIRE_SDA, PIN_WIRE_SCL);
294277
#endif
295278

296279
#endif

0 commit comments

Comments
 (0)