update makefiles

This commit is contained in:
Forsworns 2022-01-13 16:04:33 +08:00
parent bc91dc1ae2
commit 17caf1a667
8 changed files with 8 additions and 16 deletions

View File

@ -1,3 +1,3 @@
SRC_FILES :=s7_demo.c SRC_FILES :=s7_demo.cpp
include $(KERNEL_ROOT)/compiler.mk include $(KERNEL_ROOT)/compiler.mk

View File

@ -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 bRead = 1; // By default read
static int bWrite = 0; // By default not write static int bWrite = 0; // By default not write
//------------------------------------------------------------------------------
// Unit Connection
//------------------------------------------------------------------------------
static int CliConnect() static int CliConnect()
{ {
int Requested, Negotiated, res; int Requested, Negotiated, res;
@ -28,17 +23,12 @@ static int CliConnect()
}; };
return !res; return !res;
} }
//------------------------------------------------------------------------------
// Unit Disconnection
//------------------------------------------------------------------------------
static void CliDisconnect() static void CliDisconnect()
{ {
Cli_Disconnect(Client); Cli_Disconnect(Client);
} }
//------------------------------------------------------------------------------
// Perform tasks
//------------------------------------------------------------------------------
void PerformTasks() void PerformTasks()
{ {
while(true){ while(true){
@ -80,3 +70,5 @@ void s7_demo()
// Deletion // Deletion
Cli_Destroy(Client); 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);

View File

@ -4,7 +4,7 @@ menuconfig USING_CONTROL_PLC_OPCUA
default y default y
depends on RESOURCES_LWIP depends on RESOURCES_LWIP
menuconfig CONFIG_USING_CONTROL_PLC_S7 menuconfig USING_CONTROL_PLC_S7
bool "PLC support S7" bool "PLC support S7"
default y default y
depends on RESOURCES_LWIP depends on RESOURCES_LWIP

View File

@ -1,5 +1,3 @@
SRC_DIR :=
ifeq ($(CONFIG_RESOURCES_LWIP),y) ifeq ($(CONFIG_RESOURCES_LWIP),y)
ifeq ($(CONFIG_USING_CONTROL_PLC_OPCUA), y) ifeq ($(CONFIG_USING_CONTROL_PLC_OPCUA), y)

View File

@ -18,7 +18,7 @@
* @date 2021.12.15 * @date 2021.12.15
*/ */
#include "../interoperability/opcua/open62541.h" // #include "../interoperability/opcua/open62541.h"
#include "plc.h" #include "plc.h"

View File

@ -26,6 +26,7 @@ endif
ifeq ($(CONFIG_SUPPORT_CONTROL_FRAMEWORK), y) ifeq ($(CONFIG_SUPPORT_CONTROL_FRAMEWORK), y)
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control # 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/opcua #
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc/interoperability/s7 #
endif endif
ifeq ($(CONFIG_CRYPTO), y) ifeq ($(CONFIG_CRYPTO), y)

View File

@ -253,6 +253,7 @@ endif
ifeq ($(CONFIG_SUPPORT_CONTROL_FRAMEWORK), y) ifeq ($(CONFIG_SUPPORT_CONTROL_FRAMEWORK), y)
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control # 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/opcua #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc/interoperability/s7 #
endif endif
ifeq ($(CONFIG_CRYPTO), y) ifeq ($(CONFIG_CRYPTO), y)