Fix static id problem when using OTA bootloader. Reported by tekka.

This commit is contained in:
Henrik Ekblad
2015-02-01 15:29:02 +01:00
parent 7a54cacacf
commit 2d214a1e58
+3 -1
View File
@@ -59,9 +59,11 @@ void MySensor::begin(void (*_msgCallback)(const MyMessage &), uint8_t _nodeId, b
autoFindParent = true; autoFindParent = true;
} }
if (_nodeId != AUTO) { if ( (_nodeId != AUTO) && (nc.nodeId != _nodeId) ) {
// Set static id // Set static id
nc.nodeId = _nodeId; nc.nodeId = _nodeId;
// Save static id in eeprom
eeprom_write_byte((uint8_t*)EEPROM_NODE_ID_ADDRESS, _nodeId);
} }
// If no parent was found in eeprom. Try to find one. // If no parent was found in eeprom. Try to find one.