src/EEPROMWearLevel.cpp
void EEPROMWearLevel::programZeroBitsToZero(int index, byte byteWithZeros) {
	byte mask = 1;
	int bitPosInByte = 7;
	// do while bit still in mask
	while (mask != 0) {
		if ((byteWithZeros & mask) == 0) {
			fakeEeprom[index] &= ~(1 << (7 - bitPosInByte));
		}
		mask <<= 1;
		bitPosInByte--;
	}
}
// emulate EEPROM behaviour to program only bits that are 0
emulate EEPROM behaviour to program only bits that are 0
emulate EEPROM behaviour to program only bits that are 0
void EEPROMWearLevel::programZeroBitsToZero(int index, byte byteWithZeros) {
	byte mask = 1;
	int bitPosInByte = 7;
	while (mask != 0) {
		if ((byteWithZeros & mask) == 0) {
			fakeEeprom[index] &= ~(1 << (7 - bitPosInByte));
		}
		mask <<= 1;
		bitPosInByte--;
	}
}
void EEPROMWearLevel :: programZeroBitsToZero ( int index , byte byteWithZeros ) { byte mask = 1 ; int bitPosInByte = 7 ; while ( mask != 0 ) { if ( ( byteWithZeros & mask ) == 0 ) { fakeEeprom [ index ] &= ~ ( 1 << ( 7 - bitPosInByte ) ) ; } mask <<= 1 ; bitPosInByte -- ; } }
emulate EEPROM behaviour to program only bits that are 0
emulate EEPROM behaviour to program only bits that are 0
// do while bit still in mask