From 17caf1a667c1069886e8796a93fdf486c8437928 Mon Sep 17 00:00:00 2001 From: Forsworns <378974295@qq.com> Date: Thu, 13 Jan 2022 16:04:33 +0800 Subject: [PATCH] update makefiles --- .../Applications/control_app/s7_demo/Makefile | 2 +- .../Applications/control_app/s7_demo/s7_demo.cpp | 14 +++----------- .../Framework/control/plc/interoperability/Kconfig | 2 +- .../control/plc/interoperability/Makefile | 2 -- .../control/plc/interoperability/s7/Kconfig | 0 APP_Framework/Framework/control/plc/shared/plc.c | 2 +- Ubiquitous/XiUOS/path_app.mk | 1 + Ubiquitous/XiUOS/path_kernel.mk | 1 + 8 files changed, 8 insertions(+), 16 deletions(-) create mode 100755 APP_Framework/Framework/control/plc/interoperability/s7/Kconfig diff --git a/APP_Framework/Applications/control_app/s7_demo/Makefile b/APP_Framework/Applications/control_app/s7_demo/Makefile index 9c6cf516b..47f82b2f3 100644 --- a/APP_Framework/Applications/control_app/s7_demo/Makefile +++ b/APP_Framework/Applications/control_app/s7_demo/Makefile @@ -1,3 +1,3 @@ -SRC_FILES :=s7_demo.c +SRC_FILES :=s7_demo.cpp include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Applications/control_app/s7_demo/s7_demo.cpp b/APP_Framework/Applications/control_app/s7_demo/s7_demo.cpp index a262d15e3..3c2b05eaa 100644 --- a/APP_Framework/Applications/control_app/s7_demo/s7_demo.cpp +++ b/APP_Framework/Applications/control_app/s7_demo/s7_demo.cpp @@ -9,11 +9,6 @@ static int Area = S7AreaDB, DBNumber = 13, Start = 0, Amount = 4, WordLen = S7WL static int bRead = 1; // By default read static int bWrite = 0; // By default not write - - -//------------------------------------------------------------------------------ -// Unit Connection -//------------------------------------------------------------------------------ static int CliConnect() { int Requested, Negotiated, res; @@ -28,17 +23,12 @@ static int CliConnect() }; return !res; } -//------------------------------------------------------------------------------ -// Unit Disconnection -//------------------------------------------------------------------------------ + static void CliDisconnect() { Cli_Disconnect(Client); } -//------------------------------------------------------------------------------ -// Perform tasks -//------------------------------------------------------------------------------ void PerformTasks() { while(true){ @@ -80,3 +70,5 @@ void s7_demo() // Deletion Cli_Destroy(Client); } +SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN) | SHELL_CMD_PARAM_NUM(0), + S7Demo, s7_demo, Siemens Snap7 Demo); diff --git a/APP_Framework/Framework/control/plc/interoperability/Kconfig b/APP_Framework/Framework/control/plc/interoperability/Kconfig index 06bfac62a..17f5f9e2c 100755 --- a/APP_Framework/Framework/control/plc/interoperability/Kconfig +++ b/APP_Framework/Framework/control/plc/interoperability/Kconfig @@ -4,7 +4,7 @@ menuconfig USING_CONTROL_PLC_OPCUA default y depends on RESOURCES_LWIP -menuconfig CONFIG_USING_CONTROL_PLC_S7 +menuconfig USING_CONTROL_PLC_S7 bool "PLC support S7" default y depends on RESOURCES_LWIP \ No newline at end of file diff --git a/APP_Framework/Framework/control/plc/interoperability/Makefile b/APP_Framework/Framework/control/plc/interoperability/Makefile index d781443e4..bd2ccf3ce 100755 --- a/APP_Framework/Framework/control/plc/interoperability/Makefile +++ b/APP_Framework/Framework/control/plc/interoperability/Makefile @@ -1,5 +1,3 @@ -SRC_DIR := - ifeq ($(CONFIG_RESOURCES_LWIP),y) ifeq ($(CONFIG_USING_CONTROL_PLC_OPCUA), y) diff --git a/APP_Framework/Framework/control/plc/interoperability/s7/Kconfig b/APP_Framework/Framework/control/plc/interoperability/s7/Kconfig new file mode 100755 index 000000000..e69de29bb diff --git a/APP_Framework/Framework/control/plc/shared/plc.c b/APP_Framework/Framework/control/plc/shared/plc.c index b30206836..5bf3ffeeb 100755 --- a/APP_Framework/Framework/control/plc/shared/plc.c +++ b/APP_Framework/Framework/control/plc/shared/plc.c @@ -18,7 +18,7 @@ * @date 2021.12.15 */ -#include "../interoperability/opcua/open62541.h" +// #include "../interoperability/opcua/open62541.h" #include "plc.h" diff --git a/Ubiquitous/XiUOS/path_app.mk b/Ubiquitous/XiUOS/path_app.mk index 38f5f080a..ed25a2dd0 100644 --- a/Ubiquitous/XiUOS/path_app.mk +++ b/Ubiquitous/XiUOS/path_app.mk @@ -26,6 +26,7 @@ endif ifeq ($(CONFIG_SUPPORT_CONTROL_FRAMEWORK), y) APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control # APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc/interoperability/opcua # +APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc/interoperability/s7 # endif ifeq ($(CONFIG_CRYPTO), y) diff --git a/Ubiquitous/XiUOS/path_kernel.mk b/Ubiquitous/XiUOS/path_kernel.mk index e62ef3ef7..a39e0fff2 100755 --- a/Ubiquitous/XiUOS/path_kernel.mk +++ b/Ubiquitous/XiUOS/path_kernel.mk @@ -253,6 +253,7 @@ endif ifeq ($(CONFIG_SUPPORT_CONTROL_FRAMEWORK), y) KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control # KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc/interoperability/opcua # +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc/interoperability/s7 # endif ifeq ($(CONFIG_CRYPTO), y)