Skip to content

Commit 93c6a97

Browse files
committed
clean up
1 parent 470628d commit 93c6a97

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

libraries/SPI/SPI.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,14 @@ void SPIClass::setClockDivider(uint32_t div)
157157
} else if (div >= SPI_CLOCK_DIV8) {
158158
clockFreq = NRF_SPIM_FREQ_8M;
159159
} else {
160-
#ifdef NRF52840_XXAA
161-
if ( _spim.drv_inst_idx == NRFX_SPIM3_INST_IDX )
160+
if ( _spim.p_reg == NRF_SPIM3 )
162161
{
163162
if (div >= SPI_CLOCK_DIV4) {
164163
clockFreq = NRF_SPIM_FREQ_16M;
165164
}else {
166165
clockFreq = NRF_SPIM_FREQ_32M;
167166
}
168167
}else
169-
#endif
170168
{
171169
clockFreq = NRF_SPIM_FREQ_8M;
172170
}
@@ -234,7 +232,7 @@ void SPIClass::detachInterrupt() {
234232

235233
#if SPI_INTERFACES_COUNT > 0
236234
// use SPIM3 for highspeed 32Mhz
237-
SPIClass SPI(NRF_SPIM2, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI);
235+
SPIClass SPI(NRF_SPIM3, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI);
238236
#endif
239237

240238
#if SPI_INTERFACES_COUNT > 1

0 commit comments

Comments
 (0)