From 4b48ae5c0241036324d9fd9f78a68ce4f1ae035b Mon Sep 17 00:00:00 2001 From: WangQiang <807319473@qq.com> Date: Wed, 13 Apr 2016 14:35:15 +0000 Subject: [PATCH] --- TokenNet/Token.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/TokenNet/Token.cpp b/TokenNet/Token.cpp index b9315973..87733b03 100644 --- a/TokenNet/Token.cpp +++ b/TokenNet/Token.cpp @@ -21,6 +21,10 @@ #include "App\FlushPort.h" +#if defined(APP) +#include "BootConfig.h" +#endif + #define ShunCom_Master 0 static void StartGateway(void* param); @@ -183,6 +187,16 @@ void Token::Setup(ushort code, const char* name, COM message, int baudRate) WatchDog::Start(); #endif +#if defined(APP) + // 把引脚放进 Boot区 的 PinConfig 内 + Flash flash; + uint bootCfgAddr = 0x8010000 - 1 << 10; // 63K位置 + Config Cfg(flash,bootCfgAddr,sizeof(PinConfig)); + Config::Current = &Cfg; + static PinConfig pinCfg; + pinCfg.Load(); + PinConfig::Current = &pinCfg; +#endif // Flash最后一块作为配置区 Config::Current = &Config::CreateFlash(); }