正确判断配置区写入成功还是失败
This commit is contained in:
parent
7abf810bea
commit
327a6a24d3
|
@ -261,7 +261,7 @@ const void* Config::Set(const String& name, const Buffer& bs) const
|
||||||
// 重新搞一个配置头,使用新的数据去重新初始化
|
// 重新搞一个配置头,使用新的数据去重新初始化
|
||||||
ConfigBlock header;
|
ConfigBlock header;
|
||||||
header.Init(name, bs);
|
header.Init(name, bs);
|
||||||
header.Write(Device, (uint)cfg, bs);
|
if(!header.Write(Device, (uint)cfg, bs)) return nullptr;
|
||||||
|
|
||||||
return cfg->Data();
|
return cfg->Data();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
#include "I2C.h"
|
#include "I2C.h"
|
||||||
#include "..\Storage\Storage.h"
|
#include "..\Storage\Storage.h"
|
||||||
|
|
||||||
// 光强传感器
|
// EEPROM
|
||||||
class AT24CXX : public Storage
|
class AT24CXX : public CharStorage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
I2C* IIC; // I2C通信口
|
I2C* IIC; // I2C通信口
|
||||||
|
|
Loading…
Reference in New Issue