-removed the "weak" attribute from the alias DMAC handler functions #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As I added here: adafruit/Adafruit-GFX-Library#349
I ran into an issue when compiling my own library using PlatformIO which depends on ZeroDMA for the ATSAMD51.
I further debugged the issue today and neither my breakpoint for the DMAC_0_Handler() or the IRQHandler() function was triggered.
Sandwiched in between I found this block:
#ifdef SAMD51
void DMAC_1_Handler(void) attribute((weak, alias("DMAC_0_Handler")));
void DMAC_2_Handler(void) attribute((weak, alias("DMAC_0_Handler")));
void DMAC_3_Handler(void) attribute((weak, alias("DMAC_0_Handler")));
void DMAC_4_Handler(void) attribute((weak, alias("DMAC_0_Handler")));
#endif
And as stepped thru Adafruit_ZeroDMA::startJob I noticed that it configured an interrupt for DMA channel 2.
And still the interrupt triggered ended up in the default handler.
So I duplicated void DMAC_0_Handler(void), renamed it DMAC_2_Handler() and removed the alias line.
And it worked just fine.
Somehow the alias functions are not used when using ZeroDMA from another library.
Next I removed the "weak" attributes and now my code is running just fine.