正确判断配置区写入成功还是失败

This commit is contained in:
nnhy 2016-03-19 09:11:06 +00:00
parent 7abf810bea
commit 327a6a24d3
2 changed files with 3 additions and 3 deletions

View File

@ -261,7 +261,7 @@ const void* Config::Set(const String& name, const Buffer& bs) const
// 重新搞一个配置头,使用新的数据去重新初始化
ConfigBlock header;
header.Init(name, bs);
header.Write(Device, (uint)cfg, bs);
if(!header.Write(Device, (uint)cfg, bs)) return nullptr;
return cfg->Data();
}

View File

@ -4,8 +4,8 @@
#include "I2C.h"
#include "..\Storage\Storage.h"
// 光强传感器
class AT24CXX : public Storage
// EEPROM
class AT24CXX : public CharStorage
{
public:
I2C* IIC; // I2C通信口