chipKIT32 / chipKIT32-MAX

Multi-platform IDE derived version from Arduino 0022 for the chipKit.
http://chipkit.net
Other
108 stars 76 forks source link

Remove all vestiges of plilb.h from source #623

Open EmbeddedMan opened 8 years ago

EmbeddedMan commented 8 years ago

There are a few variants that still include plib.h. Remove these includes.

EmbeddedMan commented 8 years ago

Turns out that the quick240 board uses mSYSTEMLock() and mSYSTEMUnlock() from plib.h. Turns out there are actually four boards that should be using these plib.h macros as they try to write to the OSCCON register to turn off the secondary oscillator. So fixing this issue will require moving those macros (and the DmaSuspend() that they depend on) into our core libraries.

EmbeddedMan commented 8 years ago

Turns out that there is a huge rabbit hole here. To replace the mSYSTEMUlock() macro from plib.h, we need to implement DmaSuspend(), which is part of plib.h, and which has different code for each of the three different types of DMA on PIC32. I'm not sure re-writing this section of the plib.h system is worth it at this point. It is unlikely that users will have DMA already turned on when the _board_init() function is called from Board_Data.c on boot time. So I'm just going to ignore DMA for this unlock sequence.

majenkotech commented 8 years ago

When I finally get round to finishing my DMA abstraction layer I will add a function dma_suspend() and dma_resume() for you.

EmbeddedMan commented 8 years ago

You are so awesome. Thanks Matt!

On Wed, Oct 21, 2015 at 8:40 AM, Matt Jenkins notifications@github.com wrote:

When I finally get round to finishing my DMA abstraction layer I will add a function dma_suspend() and dma_resume() for you.

— Reply to this email directly or view it on GitHub https://github.com/chipKIT32/chipKIT32-MAX/issues/623#issuecomment-149898946 .

EmbeddedMan commented 8 years ago

The original issue should now be fixed. No boards or libraries include plib.h anymore.