public override void SetExtruderCurrent(ushort current) { var eepromMapping1 = new EEPROMMapping(m_oBootloaderConnection.ReadAllReadableEEPROM(), MyPrinterProfile.EEPROMConstants); if (eepromMapping1.GetUInt16("ExtruderCurrent") == current) { return; } m_oBootloaderConnection.WriteToEEPROM(GetEEPROMDataLocation("ExtruderCurrent"), BitConverter.GetBytes(current)); var eepromMapping2 = new EEPROMMapping(m_oBootloaderConnection.ReadAllReadableEEPROM(), MyPrinterProfile.EEPROMConstants); if (eepromMapping1.GetUInt16("ExtruderCurrent") == current) { WriteLog(">> ok", Logger.TextType.Read); } else { WriteLog(">> failed", Logger.TextType.Read); } }
private void CheckEEPROMValuesAfterUpdate() { var eepromMapping = new EEPROMMapping(m_oBootloaderConnection.ReadAllReadableEEPROM(), MyPrinterProfile.EEPROMConstants); var uint32 = (int)eepromMapping.GetUInt32("FirmwareVersion"); byte[] bytes = new byte[4]; if (eepromMapping.GetUInt16("SavedZState") != 0) { return; } m_oBootloaderConnection.WriteToEEPROM(GetEEPROMDataLocation("LastRecordedZValue"), bytes); }