Temporarily disable NVMCTRL line caches when writing, per SAMD51 errata. Restore them to original settings when done.
Invalidate CMCC cache after writing if it was in use .
Tested on an early SAMD51, which might have been more likely to have the cache issues. Without the CMCC invalidation, the test program in #27 returned incorrect results, as noted by some commenters in that issue.
Fixes #37 and cache issues noted in #27.
Tested on an early SAMD51, which might have been more likely to have the cache issues. Without the CMCC invalidation, the test program in #27 returned incorrect results, as noted by some commenters in that issue.