..and once again I got bitten by another library bug & wasted another couple of hours.
Microchip PLIB this time - an incorrect value somewhere in the library writes interrupt priority bits to the wrong register.
OK This may be slightly more readable, once you've dug through the docs to find the right syntax...
INTSetVectorPriority(INT_SPI_2_VECTOR, INT_PRIORITY_LEVEL_2);
but this would have been quicker to look up, and actually work.
IPC9bits.SPI2IP=2;
If I hadn't already got SPI1 working and just found this when swapping to SPI2, I hate to think how much longer it would have taken to track down.
In the past I also used to lost time tracking bugs in mchp libs, I almost always ended up having a patched lib for this project, a patched lib for that project, etc. But enough is enough.
Of course I have libs made by me, but I get a new PIC and here I go updating the libs...
For some projects I simple don't use any lib, do it all the direct way with registers.
Going back to mchp Harmony, just out of curiosity I tested it a bit, and guess what, bugs and more bugs.
I'm also one of those that think the business model of mchp software is simple wrong.