Changed a filename Dvecie.cpp > SBDevice.cpp.
Increased the version number.
This commit is contained in:
parent
a0cb35706c
commit
9c7ad75225
@ -1,5 +1,5 @@
|
|||||||
name=SBNetwork
|
name=SBNetwork
|
||||||
version=1.0.4
|
version=1.1.0
|
||||||
author=Schullebernd,schullebernd@googlemail.com
|
author=Schullebernd,schullebernd@googlemail.com
|
||||||
maintainer=Schullebernd,schullebernd@googlemail.com
|
maintainer=Schullebernd,schullebernd@googlemail.com
|
||||||
sentence=Build simple master/client networks with nRF24L01 transmitter.
|
sentence=Build simple master/client networks with nRF24L01 transmitter.
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
#include "SBDevice.h"
|
|
||||||
|
|
||||||
SBMasterStorage SBMasterStorage::initialize() {
|
|
||||||
SBMasterStorage storage;
|
|
||||||
#if defined(ESP8266)
|
|
||||||
EEPROM.begin(SB_NETWORK_FLASH_SIZE);
|
|
||||||
#endif
|
|
||||||
EEPROM.get(0 + sizeof(SBNetworkDevice), storage);
|
|
||||||
if (storage.ID[0] != 'M' || storage.ID[1] != 'S') {
|
|
||||||
// We have to create a new one
|
|
||||||
storage.ID[0] = 'M';
|
|
||||||
storage.ID[1] = 'S';
|
|
||||||
Serial.println("Creating new Master Storage");
|
|
||||||
EEPROM.put(0 + sizeof(SBNetworkDevice), storage);
|
|
||||||
#if defined(ESP8266)
|
|
||||||
EEPROM.commit();
|
|
||||||
EEPROM.end();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
return storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SBMasterStorage::save() {
|
|
||||||
#if defined(ESP8266)
|
|
||||||
EEPROM.begin(SB_NETWORK_FLASH_SIZE);
|
|
||||||
#endif
|
|
||||||
EEPROM.put(sizeof(SBNetworkDevice), *this);
|
|
||||||
#if defined(ESP8266)
|
|
||||||
EEPROM.commit();
|
|
||||||
EEPROM.end();
|
|
||||||
#endif
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user