From 327a6a24d31f180e729854d7ca8a00462e053e3c Mon Sep 17 00:00:00 2001 From: nnhy Date: Sat, 19 Mar 2016 09:11:06 +0000 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E5=88=A4=E6=96=AD=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=8C=BA=E5=86=99=E5=85=A5=E6=88=90=E5=8A=9F=E8=BF=98?= =?UTF-8?q?=E6=98=AF=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config.cpp | 2 +- Drivers/AT24CXX.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Config.cpp b/Config.cpp index 9cac826c..a2e86b1e 100644 --- a/Config.cpp +++ b/Config.cpp @@ -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(); } diff --git a/Drivers/AT24CXX.h b/Drivers/AT24CXX.h index e951a02a..5979069f 100644 --- a/Drivers/AT24CXX.h +++ b/Drivers/AT24CXX.h @@ -4,8 +4,8 @@ #include "I2C.h" #include "..\Storage\Storage.h" -// 光强传感器 -class AT24CXX : public Storage +// EEPROM +class AT24CXX : public CharStorage { public: I2C* IIC; // I2C通信口