-
Notifications
You must be signed in to change notification settings - Fork 27
Description
From
Adafruit_ZeroDMA/Adafruit_ZeroDMA.cpp
Line 450 in 64dce3e
DmacDescriptor *Adafruit_ZeroDMA::addDescriptor( |
You'll want to keep the pointer for later if you need to modify or free the descriptor.
Looking at the implementation, &_descriptor[channel]
is being return if addDescriptor
is first called on a new Adafruit_ZeroDMA
object. _descriptor
is allocated statically in the .hsram
section.
If I understood the code correctly, freeing the pointer returned from the first call to addDescriptor
is freeing a non heap ptr which will cause an error.
The description should be updated so the first descriptor will be treated differently thus not freed by accident.
Or with more changes, caller of addDescriptor
should be able to treat descriptors returned from it in the same way.