Write parentNodeId to eeprom only when differ
This commit is contained in:
@@ -51,9 +51,11 @@ void MySensor::begin(void (*_msgCallback)(const MyMessage &), uint8_t _nodeId, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_parentNodeId != AUTO) {
|
if (_parentNodeId != AUTO) {
|
||||||
nc.parentNodeId = _parentNodeId;
|
if (_parentNodeId != nc.parentNodeId) {
|
||||||
// Save static parent id in eeprom
|
nc.parentNodeId = _parentNodeId;
|
||||||
eeprom_write_byte((uint8_t*)EEPROM_PARENT_NODE_ID_ADDRESS, _parentNodeId);
|
// Save static parent id in eeprom
|
||||||
|
eeprom_write_byte((uint8_t*)EEPROM_PARENT_NODE_ID_ADDRESS, _parentNodeId);
|
||||||
|
}
|
||||||
autoFindParent = false;
|
autoFindParent = false;
|
||||||
} else {
|
} else {
|
||||||
autoFindParent = true;
|
autoFindParent = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user