Skip to content

Commit 420b9a8

Browse files
Small SPI lib fix, add SWO pin to variant header
1 parent fd40287 commit 420b9a8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

libraries/SPI/SPI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void SPIClass::transfer(const void* txbuf, void* rxbuf, size_t count,
321321
bool blockThisPass;
322322
if(count > 65535) { // Too big for 1 descriptor
323323
blockThisPass = true;
324-
bytesThisPass = count % 65535; // Fractional part
324+
bytesThisPass = count & 65535; // Fractional part
325325
if(!bytesThisPass) bytesThisPass = 65535;
326326
} else {
327327
blockThisPass = block;

variants/grand_central_m4/variant.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ const PinDescription g_APinDescription[]=
181181
// ----------------------
182182
// 95 SD detect
183183
{ PORTB, 31, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_15 },
184+
// 96 SWO (on debug header)
185+
{ PORTB, 30, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 },
184186
} ;
185187

186188
const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TCC3, TCC4, TC0, TC1, TC2, TC3, TC4, TC5, TC6, TC7 } ;

0 commit comments

Comments
 (0)