@@ -236,7 +236,7 @@ void SPIClass::transfer(void *buf, size_t count)
236236}
237237
238238// Pointer to SPIClass object, one per DMA channel.
239- static SPIClass *spiPtr[DMAC_CH_NUM] = { 0 }; // Inits list to NULL
239+ static SPIClass *spiPtr[DMAC_CH_NUM] = { 0 }; // Legit inits list to NULL
240240
241241void SPIClass::dmaCallback (Adafruit_ZeroDMA *dma) {
242242 // dmaCallback() receives an Adafruit_ZeroDMA object. From this we can get
@@ -247,7 +247,7 @@ void SPIClass::dmaCallback(Adafruit_ZeroDMA *dma) {
247247}
248248
249249void SPIClass::transfer (const void * txbuf, void * rxbuf, size_t count,
250- bool background ) {
250+ bool block ) {
251251
252252 // If receiving data and the RX DMA channel is not yet allocated...
253253 if (rxbuf && (readChannel.getChannel () >= DMAC_CH_NUM)) {
@@ -312,20 +312,20 @@ void SPIClass::transfer(const void* txbuf, void* rxbuf, size_t count,
312312 // We could set up a descriptor chain, but that gets more
313313 // complex. For now, instead, break up long transfers into
314314 // chunks of 65,535 bytes max...these transfers are all
315- // blocking, regardless of the "background " argument, except
315+ // blocking, regardless of the "block " argument, except
316316 // for the last one which will observe the background request.
317317 // The fractional part is done first, so for any "partially
318- // backgrounded " transfers like these at least it's the
319- // largest single-descriptor transfer possible that occurs
320- // in the background, rather than the tail end.
318+ // blocking " transfers like these at least it's the largest
319+ // single-descriptor transfer possible that occurs in the
320+ // background, rather than the tail end.
321321 int bytesThisPass;
322- bool block ;
322+ bool blockThisPass ;
323323 if (count > 65535 ) { // Too big for 1 descriptor
324- block = true ;
324+ blockThisPass = true ;
325325 bytesThisPass = count % 65535 ; // Fractional part
326326 if (!bytesThisPass) bytesThisPass = 65535 ;
327327 } else {
328- block = !background ;
328+ blockThisPass = block ;
329329 bytesThisPass = count;
330330 }
331331
@@ -353,7 +353,7 @@ void SPIClass::transfer(const void* txbuf, void* rxbuf, size_t count,
353353 dma_busy = true ;
354354 writeChannel.startJob ();
355355 count -= bytesThisPass;
356- if (block ) {
356+ if (blockThisPass ) {
357357 while (dma_busy);
358358 }
359359 }
0 commit comments