This PR has alterations to the flash IC initialisation function relating to to a bug occurring when it is called more than once. It also makes the flash IC build with C++. Closes #173 #189.
Changes:
Removed MxChangeMode as this function does not work when the handler is cleared by memset. I opted for removing this function rather than MxSoftwareInit since it would require less code in Mx25R16_Init (only four lines of MxChangeMode were needed).
Removed the unnecessary second MxSoftwareInit function call.
Added C++ guards to avoid conflicts with C code with a C++ compiler.
Notes for Reviewers:
I tested by calling MX25R16_Init three times and seeing if the tests could pass.
Should you want to test if the C++ functionality (not as important as testing if it builds regularly of course) it only really matters if the files are .cpp as well. It is only meant to protect when users want to add their own C++ code to it (like was done with both SHTC3 and LIS2DH12 libraries).
Summary:
This PR has alterations to the flash IC initialisation function relating to to a bug occurring when it is called more than once. It also makes the flash IC build with C++. Closes #173 #189.
Changes:
Notes for Reviewers:
I tested by calling MX25R16_Init three times and seeing if the tests could pass.
Should you want to test if the C++ functionality (not as important as testing if it builds regularly of course) it only really matters if the files are .cpp as well. It is only meant to protect when users want to add their own C++ code to it (like was done with both SHTC3 and LIS2DH12 libraries).