File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -333,24 +333,16 @@ void SPIClass::dmaAllocate(void) {
333
333
use_dma = true ; // Everything allocated successfully
334
334
extraWriteDescriptors = &extraReadDescriptors[numReadDescriptors];
335
335
336
- // dmac.h didn't include extern "C" which cause
337
- // DmacDescriptor and its members are defined as C++ struct therefore
338
- // memcpy will throw warning on copying where simple assignment won't work
339
- #pragma GCC diagnostic push
340
- #pragma GCC diagnostic ignored "-Wclass-memaccess"
341
-
342
336
// Initialize descriptors (copy from first ones)
337
+ // cast to void* to suppress warning: with no trivial copy-assignment [-Wclass-memaccess]
343
338
for (int i=0 ; i<numReadDescriptors; i++) {
344
- memcpy (&extraReadDescriptors[i], firstReadDescriptor,
339
+ memcpy (( void *) &extraReadDescriptors[i], firstReadDescriptor,
345
340
sizeof (DmacDescriptor));
346
341
}
347
342
for (int i=0 ; i<numWriteDescriptors; i++) {
348
- memcpy (&extraWriteDescriptors[i], firstWriteDescriptor,
343
+ memcpy (( void *) &extraWriteDescriptors[i], firstWriteDescriptor,
349
344
sizeof (DmacDescriptor));
350
345
}
351
-
352
- #pragma GCC diagnostic pop
353
-
354
346
} // end malloc
355
347
} // end extra descriptor check
356
348
You can’t perform that action at this time.
0 commit comments