1
0
Fork 0

Make Linux canopend example single thread.

Include files optionally in CANopen.h
This commit is contained in:
Janez 2020-11-28 12:20:43 +01:00
parent a6ce313387
commit d224de0ac9
2 changed files with 45 additions and 10 deletions

View file

@ -31,20 +31,58 @@
#include "301/CO_driver.h"
#include "301/CO_ODinterface.h"
#include "301/CO_NMT_Heartbeat.h"
#if ((CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_ENABLE) || defined CO_DOXYGEN
#include "301/CO_HBconsumer.h"
#endif
#include "301/CO_Emergency.h"
#include "301/CO_SDOserver.h"
#if ((CO_CONFIG_SDO_CLI) & CO_CONFIG_SDO_CLI_ENABLE) || defined CO_DOXYGEN
#include "301/CO_SDOclient.h"
#endif
#if ((CO_CONFIG_SYNC) & CO_CONFIG_SYNC_ENABLE) || defined CO_DOXYGEN
#include "301/CO_SYNC.h"
#endif
#if ((CO_CONFIG_PDO) & (CO_CONFIG_RPDO_ENABLE | CO_CONFIG_TPDO_ENABLE)) || defined CO_DOXYGEN
#include "301/CO_PDO.h"
#endif
#if ((CO_CONFIG_TIME) & CO_CONFIG_TIME_ENABLE) || defined CO_DOXYGEN
#include "301/CO_TIME.h"
#endif
#if ((CO_CONFIG_LEDS) & CO_CONFIG_LEDS_ENABLE) || defined CO_DOXYGEN
#include "303/CO_LEDs.h"
#endif
#if ((CO_CONFIG_GFC) & CO_CONFIG_GFC_ENABLE) || defined CO_DOXYGEN
#include "304/CO_GFC.h"
#endif
#if ((CO_CONFIG_SRDO) & CO_CONFIG_SRDO_ENABLE) || defined CO_DOXYGEN
#include "304/CO_SRDO.h"
#endif
#if ((CO_CONFIG_LSS) & CO_CONFIG_LSS_SLAVE) || defined CO_DOXYGEN
#include "305/CO_LSSslave.h"
#endif
#if ((CO_CONFIG_LSS) & CO_CONFIG_LSS_MASTER) || defined CO_DOXYGEN
#include "305/CO_LSSmaster.h"
#endif
#if ((CO_CONFIG_GTW) & CO_CONFIG_GTW_ASCII) || defined CO_DOXYGEN
#include "309/CO_gateway_ascii.h"
#endif
#if ((CO_CONFIG_TRACE) & CO_CONFIG_TRACE_ENABLE) || defined CO_DOXYGEN
#include "extra/CO_trace.h"
#endif
#ifdef __cplusplus
extern "C" {

View file

@ -3,8 +3,7 @@
DRV_SRC = socketCAN
CANOPEN_SRC = .
OD_SRC = example
APPL_SRC = socketCAN
APPL_SRC = example
LINK_TARGET = canopend
@ -13,7 +12,6 @@ LINK_TARGET = canopend
INCLUDE_DIRS = \
-I$(DRV_SRC) \
-I$(CANOPEN_SRC) \
-I$(OD_SRC) \
-I$(APPL_SRC)
# $(DRV_SRC)/CO_OD_storage.c \
@ -41,22 +39,21 @@ SOURCES = \
$(CANOPEN_SRC)/309/CO_gateway_ascii.c \
$(CANOPEN_SRC)/extra/CO_trace.c \
$(CANOPEN_SRC)/CANopen.c \
$(OD_SRC)/OD.c \
$(APPL_SRC)/CO_main_basic.c
$(APPL_SRC)/OD.c \
$(DRV_SRC)/CO_main_basic.c
OBJS = $(SOURCES:%.c=%.o)
CC ?= gcc
OPT = -g
OPT = -g -DCO_SINGLE_THREAD
#OPT = -g -pedantic -Wshadow -fanalyzer
#OPT = -g -DCO_USE_GLOBALS
#OPT = -g -DCO_MULTIPLE_OD
#OPT = -g -DCO_SINGLE_THREAD
CFLAGS = -Wall $(OPT) $(INCLUDE_DIRS)
LDFLAGS = -pthread
#LDFLAGS =
LDFLAGS =
#LDFLAGS = -pthread
#Options can be passed via make: 'make OPT="-g -DCO_SINGLE_THREAD" LDFLAGS=""'
#Options can be also passed via make: 'make OPT="-g" LDFLAGS="-pthread"'
.PHONY: all clean