From b1c5b979e4e9e74ff7fd9973839e55c0f7bb1513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Sun, 10 Sep 2017 19:40:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3GCC=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Board/IOK0612.cpp | 2 +- Drivers/SHT30.cpp | 3 ++- Message/Json.cpp | 4 ++-- Platform/STM32F4/Flash.cpp | 5 +++-- TokenNet/TokenClient.cpp | 2 +- Tool/_Files.cs | 18 ++++++++++++++++++ 6 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 Tool/_Files.cs diff --git a/Board/IOK0612.cpp b/Board/IOK0612.cpp index d45929b6..849293a7 100644 --- a/Board/IOK0612.cpp +++ b/Board/IOK0612.cpp @@ -18,7 +18,7 @@ IOK0612::IOK0612() Current = this; } -static bool ledstat2 = false; +//static bool ledstat2 = false; //重写指示灯默认倒置 void IOK0612::InitLeds() diff --git a/Drivers/SHT30.cpp b/Drivers/SHT30.cpp index e90427ed..5534af8f 100644 --- a/Drivers/SHT30.cpp +++ b/Drivers/SHT30.cpp @@ -164,7 +164,8 @@ bool SHT30::Open() if (Pwr) *Pwr = true; - bool rs = CheckStatus(); + //bool rs = CheckStatus(); + CheckStatus(); /* SHT30三种采集数据方式: diff --git a/Message/Json.cpp b/Message/Json.cpp index 71f68256..3599813d 100644 --- a/Message/Json.cpp +++ b/Message/Json.cpp @@ -18,7 +18,7 @@ JsonType Json::Type() const // 快速判断对象、数组和字符串 auto s = _str.Trim(); - auto p = s.GetBuffer(); + //auto p = s.GetBuffer(); int len = s.Length(); switch (s[0]) { @@ -328,7 +328,7 @@ Json& Json::Add(cstring key, const String& value) { char left = value[0]; char right = value[value.Length() - 1]; - if (left == '{'&&right == '}' || left == '['&&right == ']' || left == '\"'&&right == '\"') flag = false; + if ((left == '{' && right == '}') || (left == '[' && right == ']') || (left == '\"' && right == '\"')) flag = false; } if (flag) _str += "\""; diff --git a/Platform/STM32F4/Flash.cpp b/Platform/STM32F4/Flash.cpp index a362d334..60ffc015 100644 --- a/Platform/STM32F4/Flash.cpp +++ b/Platform/STM32F4/Flash.cpp @@ -172,7 +172,7 @@ bool Flash::ReadOutProtection(bool set) // 取消读保护会清空 Flash 内容,注意:要上电复位才可以使用IC FLASH_Unlock(); FLASH_ReadOutProtection(DISABLE); - }return set; + } #endif #if defined(STM32F0) bool isProt = FLASH_OB_GetRDP() == SET ? true : false; @@ -197,6 +197,7 @@ bool Flash::ReadOutProtection(bool set) FLASH_Unlock(); FLASH_OB_RDPConfig(OB_RDP_Level_0); FLASH_OB_Lock(); - }return set; + } #endif + return set; } diff --git a/TokenNet/TokenClient.cpp b/TokenNet/TokenClient.cpp index d18cec07..8b0d30c6 100644 --- a/TokenNet/TokenClient.cpp +++ b/TokenNet/TokenClient.cpp @@ -1014,7 +1014,7 @@ void TokenClient::OnWrite(const TokenMessage& msg, TokenController* ctrl) // 拦截给同步方法 auto handle = (WaitHandle*)_Expect; if (handle) { - auto start = (int)handle->State; + auto start = (uint)handle->State; if (start == dm.Start) { // 设置事件,通知等待任务退出循环 handle->State = (void*)dm.Size; diff --git a/Tool/_Files.cs b/Tool/_Files.cs new file mode 100644 index 00000000..854d4be4 --- /dev/null +++ b/Tool/_Files.cs @@ -0,0 +1,18 @@ +build.AddIncludes("..\\", false); +build.AddFiles("..\\Core"); +build.AddFiles("..\\Kernel"); +build.AddFiles("..\\Device"); +build.AddFiles("..\\", "*.c;*.cpp", false); +build.AddFiles("..\\Net"); +build.AddFiles("..\\Message"); +build.AddFiles("..\\Security", "*.cpp"); +build.AddFiles("..\\Board"); +build.AddFiles("..\\Storage"); +build.AddFiles("..\\App"); +build.AddFiles("..\\Drivers"); +build.AddFiles("..\\Test"); +build.AddFiles("..\\TinyIP", "*.c;*.cpp", false, "HttpClient"); +build.AddFiles("..\\TinyNet"); +build.AddFiles("..\\TokenNet"); +build.AddFiles("..\\Link"); +build.AlwaysBuild = "Sys.cpp"; \ No newline at end of file