* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
- * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and
+ * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and
* https://github.com/leaflabs/libmaple
*
* Modifications for QMK and STM32F303 by Yiancar
// Check each active page address starting from begining
for (idx = pageBase + 4; idx < pageEnd; idx += 4)
- if ((*(__IO uint32_t*)idx) == 0xFFFFFFFF) // Verify if element
+ if ((*(__IO uint32_t*)idx) == 0xFFFFFFFF) // Verify if element
{ // contents are 0xFFFFFFFF
FlashStatus = FLASH_ProgramHalfWord(idx, Data); // Set variable data
if (FlashStatus != FLASH_COMPLETE)
// Get the valid Page end Address
pageEnd = pageBase + ((uint32_t)(PageSize - 2));
-
+
// Check each active page address starting from end
for (pageBase += 6; pageEnd >= pageBase; pageEnd -= 4)
if ((*(__IO uint16_t*)pageEnd) == Address) // Compare the read address with the virtual address
{
uint16_t temp;
EEPROM_read(Address, &temp);
- if (Address == Data)
+ if (temp == Data)
return EEPROM_SAME_VALUE;
else
return EEPROM_write(Address, Data);