From 2a374f6004d83230f231f3f0ce25235014cab250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Sun, 9 Jul 2017 09:33:40 +0800 Subject: [PATCH] =?UTF-8?q?!!!=E7=83=AD=E5=AD=98=E5=82=A8=E5=8C=BA?= =?UTF-8?q?=E6=81=B0=E5=B7=A7=E4=BD=BF=E7=94=A8=E4=BA=86=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=A0=86=E6=A0=88=E9=81=BF=E5=BC=80=E7=9A=8464=E5=AD=97?= =?UTF-8?q?=E8=8A=82=EF=BC=8C=E5=BD=93=E6=95=B0=E6=8D=AE=E5=8C=BA=E5=A4=A7?= =?UTF-8?q?=E4=BA=8E=E4=B8=80=E5=AE=9A=E5=AD=97=E8=8A=82=E6=95=B0=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=B0=B1=E4=BC=9A=E5=AF=BC=E8=87=B4=E7=83=AD=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E5=8C=BA=E6=9C=AB=E7=AB=AF=E8=B6=85=E5=87=BA=E5=86=85?= =?UTF-8?q?=E5=AD=98RAM=E8=BE=B9=E7=95=8C=EF=BC=8C=E4=BB=8E=E8=80=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=B4=A9=E6=BA=83=E3=80=82=20=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E6=8A=8A=E5=AE=83=E6=94=B9=E4=B8=BA256=E5=AD=97?= =?UTF-8?q?=E8=8A=82=EF=BC=8C=E5=B0=9A=E6=9C=AA=E6=89=BE=E5=88=B0=E4=B8=80?= =?UTF-8?q?=E5=8A=B3=E6=B0=B8=E9=80=B8=E7=9A=84=E8=A7=A3=E5=86=B3=E5=8A=9E?= =?UTF-8?q?=E6=B3=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config.cpp | 8 +++++++- Kernel/Sys.cpp | 2 +- Kernel/Task.cpp | 6 +++--- Platform/CortexM/Sys.cpp | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Config.cpp b/Config.cpp index 7d8f2c87..821713b6 100644 --- a/Config.cpp +++ b/Config.cpp @@ -393,7 +393,13 @@ const Config& Config::CreateRAM() { // 最后一块作为配置区 static CharStorage cs; - static Config cfg(cs, Sys.StackTop(), 64); + static Config cfg(cs, Sys.StackTop(), 256); + + /*// 从堆申请一块内存 + if (cfg.Size == 0) { + cfg.Address = (uint)new byte[256]; + cfg.Size = 256; + }*/ return cfg; } diff --git a/Kernel/Sys.cpp b/Kernel/Sys.cpp index 394afeca..77394f97 100644 --- a/Kernel/Sys.cpp +++ b/Kernel/Sys.cpp @@ -89,7 +89,7 @@ void TSys::ShowInfo() const debug_printf("Time : "); DateTime::Now().Show(false); debug_printf(" Start: %d/%d \r\n", HotStart, StartTimes); - debug_printf("Support: http://www.WsLink.cn\r\n"); + //debug_printf("Support: http://www.WsLink.cn\r\n"); debug_printf("\r\n"); #endif diff --git a/Kernel/Task.cpp b/Kernel/Task.cpp index 610a7b56..e6a18ef9 100644 --- a/Kernel/Task.cpp +++ b/Kernel/Task.cpp @@ -124,7 +124,7 @@ INROOT bool Task::CheckTime(UInt64 end, bool isSleep) // 全局任务调度器 TaskScheduler* Task::Scheduler() { - static TaskScheduler _sc("Sys"); + static TaskScheduler _sc("Task"); return &_sc; } @@ -256,7 +256,7 @@ uint TaskScheduler::Add(Action func, void* param, int dueTime, int period, cstri Count++; #if DEBUG - debug_printf("%s::添加%d %s First=%dms Period=%dms 0x%p\r\n", Name, task->ID, name, dueTime, period, func); + debug_printf("%s::Add%d %s First=%dms Period=%dms 0x%p\r\n", Name, task->ID, name, dueTime, period, func); #endif return task->ID; @@ -271,7 +271,7 @@ void TaskScheduler::Remove(uint taskid) auto task = (Task*)_Tasks[i]; if(task->ID == taskid) { - debug_printf("%s::删除%d %s 0x%p\r\n", Name, task->ID, task->Name, task->Callback); + debug_printf("%s::Remove%d %s 0x%p\r\n", Name, task->ID, task->Name, task->Callback); // 清零ID,实现重用 task->ID = 0; diff --git a/Platform/CortexM/Sys.cpp b/Platform/CortexM/Sys.cpp index 8f2848d7..be60fd8c 100644 --- a/Platform/CortexM/Sys.cpp +++ b/Platform/CortexM/Sys.cpp @@ -177,7 +177,7 @@ uint TSys::HeapBase() const // 栈顶,后面是初始化不清零区域 uint TSys::StackTop() const { - return SRAM_BASE + (RAMSize << 10) - 0x40; + return SRAM_BASE + (RAMSize << 10) - 0x100; } void TSys::SetStackTop(uint addr)