正确判断配置区写入成功还是失败
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;
|
||||
header.Init(name, bs);
|
||||
header.Write(Device, (uint)cfg, bs);
|
||||
if(!header.Write(Device, (uint)cfg, bs)) return nullptr;
|
||||
|
||||
return cfg->Data();
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#include "I2C.h"
|
||||
#include "..\Storage\Storage.h"
|
||||
|
||||
// 光强传感器
|
||||
class AT24CXX : public Storage
|
||||
// EEPROM
|
||||
class AT24CXX : public CharStorage
|
||||
{
|
||||
public:
|
||||
I2C* IIC; // I2C通信口
|
||||
|
|
Loading…
Reference in New Issue