Commit 4b8f214d authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

move controller to new build

parent 56d8add4
......@@ -25,13 +25,13 @@
#include <controller/controller_block.h>
#include "block_beckhoff_el3xxx.h"
#include "ec.h"
#include "esc.h"
#include "esc_esi.h"
#include "esc_coe.h"
#include "esc_id.h"
#include "log.h"
#include <ec/block_beckhoff_el3xxx.h>
#include <ec/ec.h>
#include <ec/esc.h>
#include <ec/esc_esi.h>
#include <ec/esc_coe.h>
#include <ec/esc_id.h>
#include <log/log.h>
struct controller_block_private {
......
......@@ -23,13 +23,13 @@
#include <controller/controller_block.h>
#include "block_beckhoff_el4xxx.h"
#include "ec.h"
#include "esc.h"
#include "esc_esi.h"
#include "esc_coe.h"
#include "esc_id.h"
#include "log.h"
#include <ec/block_beckhoff_el4xxx.h>
#include <ec/ec.h>
#include <ec/esc.h>
#include <ec/esc_esi.h>
#include <ec/esc_coe.h>
#include <ec/esc_id.h>
#include <log/log.h>
struct controller_block_private {
float *output[8];
......
......@@ -24,12 +24,12 @@
#include <controller/controller_block.h>
#include "ec.h"
#include "esc.h"
#include "esc_esi.h"
#include "esc_coe.h"
#include "esc_id.h"
#include "log.h"
#include <ec/ec.h>
#include <ec/esc.h>
#include <ec/esc_esi.h>
#include <ec/esc_coe.h>
#include <ec/esc_id.h>
#include <log/log.h>
struct controller_block_private {
float converted_value;
......
......@@ -28,13 +28,13 @@
#include <controller/controller_block.h>
#include "block_beckhoff_el5101.h"
#include "ec.h"
#include "esc.h"
#include "esc_esi.h"
#include "esc_coe.h"
#include "esc_id.h"
#include "log.h"
#include <ec/block_beckhoff_el5101.h>
#include <ec/ec.h>
#include <ec/esc.h>
#include <ec/esc_esi.h>
#include <ec/esc_coe.h>
#include <ec/esc_id.h>
#include <log/log.h>
#define EL5101_OBJ_SM_OUTPUT 0x1c32
......
......@@ -32,12 +32,12 @@
#include <controller/controller_block.h>
#include "ec.h"
#include "esc.h"
#include "esc_esi.h"
#include "esc_coe.h"
#include "esc_id.h"
#include "log.h"
#include <ec/ec.h>
#include <ec/esc.h>
#include <ec/esc_esi.h>
#include <ec/esc_coe.h>
#include <ec/esc_id.h>
#include <log/log.h>
struct controller_block_private {
unsigned char *rx_buffer;
......
......@@ -23,9 +23,9 @@
#include <controller/controller_block.h>
#include "block_ec.h"
#include "ec.h"
#include "log.h"
#include <ec/block_ec.h>
#include <ec/ec.h>
#include <log/log.h>
static struct controller_block *ec_block = NULL;
......
......@@ -20,10 +20,10 @@
#include <string.h>
#include <stdio.h>
#include "controller_block.h"
#include "esc.h"
#include "ec_stoeber.h"
#include "log.h"
#include <controller/controller_block.h>
#include <ec/esc.h>
#include <ec/ec_stoeber.h>
#include <log/log.h>
#define RPM2RADS(val) ((val)*2.0*M_PI/60.0)
......
EC_TARGETS += $(LIBDIR)/libethercat.la
EC_SRCS = \
$(DIR)/ec.c \
$(DIR)/esc.c \
$(DIR)/esc_coe.c \
$(DIR)/esc_esi.c \
$(DIR)/esc_mailbox.c \
$(DIR)/esc_device.c \
$(DIR)/esc_watchdog.c \
$(DIR)/esc_dc.c \
$(DIR)/canopen.c \
$(DIR)/ec_stoeber.c \
$(DIR)/block_ec.c \
$(DIR)/block_beckhoff_el1xxx.c \
$(DIR)/block_beckhoff_el2xxx.c \
$(DIR)/block_beckhoff_el2502.c \
$(DIR)/block_beckhoff_el3xxx.c \
$(DIR)/block_beckhoff_el4xxx.c \
$(DIR)/block_beckhoff_el5001.c \
$(DIR)/block_beckhoff_el5101.c \
$(DIR)/block_beckhoff_el7031.c \
$(DIR)/block_stoeber.c
ifeq ($(OS), FreeBSD)
EC_SRCS+= $(DIR)/eth_bsd.c
else
EC_SRCS+= $(DIR)/eth_linux.c
endif
EC_OBJS := $(EC_SRCS:.c=.lo)
$(LIBDIR)/libethercat.la: libcontroller.la liblog.la
$(LIBDIR)/libethercat.la: LDFLAGS += -lm -lpthread -lcontroller -llog
$(LIBDIR)/libethercat.la: CFLAGS += -O3 -Wall
$(LIBDIR)/libethercat.la: $(EC_OBJS)
$(LIB_LINK)
EC_TARGETS += $(DIR)/ec_enum
EC_ENUM_SRCS = $(DIR)/ec_enum.c
EC_ENUM_OBJS := $(EC_ENUM_SRCS:.c=.o)
$(DIR)/ec_enum: libethercat.la
$(DIR)/ec_enum: CFLAGS += -O3 -Wall
$(DIR)/ec_enum: LDFLAGS += -lethercat
$(DIR)/ec_enum: $(EC_ENUM_OBJS)
TARGETS += $(EC_TARGETS)
CLEAN += $(EC_TARGETS) $(EC_OBJS) $(EC_ENUM_OBJS)
SRCS += $(EC_SRCS) $(EC_ENUM_SRCS)
......@@ -27,9 +27,9 @@
#include <sys/endian.h>
#endif
#include "canopen.h"
#include <ec/canopen.h>
#include "log.h"
#include <log/log.h>
#define CANOPEN_CSS_MASK 0xe0
#define CANOPEN_CSS_INITIATE_DOMAIN_DOWNLOAD (0x1 << 5) // 0x20
......
......@@ -34,12 +34,12 @@
#include <pthread.h>
#include <semaphore.h>
#include "controller_sample.h"
#include <controller/controller_sample.h>
#include "ec.h"
#include "ec_int.h"
#include "eth.h"
#include "log.h"
#include <ec/ec.h>
#include <ec/ec_int.h>
#include <ec/eth.h>
#include <log/log.h>
static int ec_sock;
......
......@@ -34,7 +34,7 @@
#define __packed __attribute__((packed))
#endif
#include "canopen.h"
#include <ec/canopen.h>
int ec_init(char *ifname, bool single_cycle);
bool ec_initialized(void);
......
......@@ -25,12 +25,12 @@
#include <ctype.h>
#include <stdarg.h>
#include "ec.h"
#include "esc.h"
#include "esc_esi.h"
#include "esc_registers.h"
#include "esc_id.h"
#include "log.h"
#include <ec/ec.h>
#include <ec/esc.h>
#include <ec/esc_esi.h>
#include <ec/esc_registers.h>
#include <ec/esc_id.h>
#include <log/log.h>
/* Local override, we don't want a complete log implementation */
void log_send(enum log_type type, char *fmt, ...)
......
......@@ -20,9 +20,9 @@
#ifndef _INCLUDE_EC_INT_H_
#define _INCLUDE_EC_INT_H_
#include "ec.h"
#include "esc.h"
#include "esc_registers.h"
#include <ec/ec.h>
#include <ec/esc.h>
#include <ec/esc_registers.h>
#define ETH_P_ETHERCAT 0x88a4
......
......@@ -21,13 +21,13 @@
#include <stdlib.h>
#include <math.h>
#include "esc.h"
#include "esc_esi.h"
#include "esc_coe.h"
#include "esc_mailbox.h"
#include "ec_stoeber.h"
#include "esc_dc.h"
#include "log.h"
#include <ec/esc.h>
#include <ec/esc_esi.h>
#include <ec/esc_coe.h>
#include <ec/esc_mailbox.h>
#include <ec/ec_stoeber.h>
#include <ec/esc_dc.h>
#include <log/log.h>
static void ec_stoeber_emergency_handler(struct canopen_dev *dev,
uint16_t code, uint8_t reg, uint8_t vendor[5])
......
......@@ -20,8 +20,8 @@
#ifndef _INCLUDE_EC_STOEBER_H_
#define _INCLUDE_EC_STOEBER_H_
#include "ec.h"
#include "canopen.h"
#include <ec/ec.h>
#include <ec/canopen.h>
#define STOEBER_PARAM2INDEX(group, nr) (0x2000 + ((group) - 'A') * 0x200 + nr)
......
......@@ -23,10 +23,10 @@
#include <unistd.h>
#include <time.h>
#include "ec.h"
#include "esc.h"
#include "esc_coe.h"
#include "canopen.h"
#include <ec/ec.h>
#include <ec/esc.h>
#include <ec/esc_coe.h>
#include <ec/canopen.h>
int main (int argc, char **argv)
{
......
......@@ -21,11 +21,11 @@
#include <stdio.h>
#include <time.h>
#include "esc.h"
#include "esc_registers.h"
#include "ec.h"
#include "canopen.h"
#include "log.h"
#include <ec/esc.h>
#include <ec/esc_registers.h>
#include <ec/ec.h>
#include <ec/canopen.h>
#include <log/log.h>
bool esc_timeout_expired(struct timespec *start, struct timespec *timeout)
......
......@@ -23,9 +23,9 @@
#include <unistd.h>
#include <time.h>
#include <ec.h>
#include <ec/ec.h>
#include "esc_sm.h"
#include <ec/esc_sm.h>
int esc_init(struct ec_dgram_addr *addr);
......
......@@ -28,9 +28,9 @@
#include <limits.h>
#include <unistd.h>
#include "ec.h"
#include "esc_coe.h"
#include "log.h"
#include <ec/ec.h>
#include <ec/esc_coe.h>
#include <log/log.h>
......
......@@ -20,7 +20,7 @@
#ifndef _INCLUDE_EC_ESC_COE_H_
#define _INCLUDE_EC_ESC_COE_H_
#include "esc_mailbox.h"
#include <ec/esc_mailbox.h>
struct canopen_dev *esc_coe_create(struct esc_mailbox *mailbox);
void esc_coe_destroy(struct canopen_dev *coe);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment