Skip to content

Commit

Permalink
#3 writing new EEPROM file even if it wasn't written to and has defau…
Browse files Browse the repository at this point in the history
…lt content (0xff).
  • Loading branch information
laoo committed Oct 28, 2021
1 parent 6791ed3 commit 723da7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libFelix/EEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "TraceHelper.hpp"

EEPROM::EEPROM( std::filesystem::path imagePath, int eeType, bool is16Bit, std::shared_ptr<TraceHelper> traceHelper ) : mEECoroutine{ process() }, mImagePath{ std::move( imagePath ) },
mTraceHelper{ std::move( traceHelper ) }, mData{}, mAddressBits{}, mDataBits{}, mWriteEnable{}, mChanged{}
mTraceHelper{ std::move( traceHelper ) }, mData{}, mAddressBits{}, mDataBits{}, mWriteEnable{}, mChanged{ true }
{
assert( eeType != 0 );

Expand All @@ -27,6 +27,7 @@ EEPROM::EEPROM( std::filesystem::path imagePath, int eeType, bool is16Bit, std::
auto size = std::min( std::filesystem::file_size( mImagePath ), mData.size() );
std::ifstream fin{ mImagePath, std::ios::binary };
fin.read( (char*)mData.data(), size );
mChanged = false;
}
}

Expand Down

0 comments on commit 723da7e

Please sign in to comment.