/* Commits any cached data to physical non-volatile memory. 
Commits the internal SRAM caches to physical non-volatile memory, to ensure that any outstanding cached data is preserved. This function should be called prior to a system reset or shutdown to prevent data loss. */
enum status_code rww_eeprom_emulator_commit_page_buffer(void)
/* Commits any cached data to physical non-volatile memory. 
Commits the internal SRAM caches to physical non-volatile memory, to ensure that any outstanding cached data is preserved. This function should be called prior to a system reset or shutdown to prevent data loss. */
enum status_code rww_eeprom_emulator_commit_page_buffer(void)
{
	enum status_code error_code = STATUS_OK;
	if (_eeprom_instance.cache_active == false) {
		return STATUS_OK;
	}
	uint8_t cached_logical_page = _eeprom_instance.cache.header.logical_page;
	_rww_eeprom_emulator_nvm_commit_cache(
			_eeprom_instance.page_map[cached_logical_page]);
	barrier();
	_eeprom_instance.cache_active = false;
	return error_code;
}