Added --enable-wildcards to use 0xffffffff as wildcard for vendor ID and
product code.
This commit is contained in:
parent
0b32dd07dd
commit
ef4fc90c7d
2
NEWS
2
NEWS
|
|
@ -76,6 +76,8 @@ Changes in 1.5:
|
||||||
* ethercat tool is now able to handle multiple masters. The --masters option
|
* ethercat tool is now able to handle multiple masters. The --masters option
|
||||||
supports ranges like '0,3,8-10'.
|
supports ranges like '0,3,8-10'.
|
||||||
* A sync manager is always enabled, if it contains registered process data.
|
* A sync manager is always enabled, if it contains registered process data.
|
||||||
|
* Added a configuration switch --enable-wildcards to use 0xffffffff as a
|
||||||
|
* wildcard for vendor ID and product code.
|
||||||
|
|
||||||
Changes in 1.4.0:
|
Changes in 1.4.0:
|
||||||
|
|
||||||
|
|
|
||||||
27
configure.ac
27
configure.ac
|
|
@ -1,6 +1,6 @@
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# $Id$
|
# $Id: configure.ac,v 1baafcd263cc 2011/07/06 14:37:40 fp $
|
||||||
#
|
#
|
||||||
# Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH
|
# Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH
|
||||||
#
|
#
|
||||||
|
|
@ -751,6 +751,31 @@ AC_ARG_ENABLE([tty],
|
||||||
AM_CONDITIONAL(ENABLE_TTY, test "x$tty" = "x1")
|
AM_CONDITIONAL(ENABLE_TTY, test "x$tty" = "x1")
|
||||||
AC_SUBST(ENABLE_TTY,[$tty])
|
AC_SUBST(ENABLE_TTY,[$tty])
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Slave identification wildcards
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([wildcards],
|
||||||
|
AS_HELP_STRING([--enable-wildcards],
|
||||||
|
[Enable vendor ID / product code wildcards (default: no)]),
|
||||||
|
[
|
||||||
|
case "${enableval}" in
|
||||||
|
yes) wildcards=1
|
||||||
|
;;
|
||||||
|
no) wildcards=0
|
||||||
|
;;
|
||||||
|
*) AC_MSG_ERROR([Invalid value for --enable-wildcards])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
],
|
||||||
|
[wildcards=0]
|
||||||
|
)
|
||||||
|
|
||||||
|
if test "x${wildcards}" = "x1"; then
|
||||||
|
AC_DEFINE([EC_IDENT_WILDCARDS], [1],
|
||||||
|
[Use vendor id / product code wildcards])
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: slave_config.c,v 8c63d804ead9 2011/08/11 18:44:18 fp $
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
|
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
|
||||||
*
|
*
|
||||||
|
|
@ -234,12 +234,28 @@ int ec_slave_config_attach(
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slave->sii.vendor_id != sc->vendor_id
|
if (
|
||||||
|| slave->sii.product_code != sc->product_code) {
|
#ifdef EC_IDENT_WILDCARDS
|
||||||
EC_CONFIG_DBG(sc, 1, "Slave %u has an invalid type (0x%08X/0x%08X)"
|
sc->vendor_id != 0xffffffff &&
|
||||||
" for configuration (0x%08X/0x%08X).\n",
|
#endif
|
||||||
slave->ring_position, slave->sii.vendor_id,
|
slave->sii.vendor_id != sc->vendor_id
|
||||||
slave->sii.product_code, sc->vendor_id, sc->product_code);
|
) {
|
||||||
|
EC_CONFIG_DBG(sc, 1, "Slave %u has no matching vendor ID (0x%08X)"
|
||||||
|
" for configuration (0x%08X).\n",
|
||||||
|
slave->ring_position, slave->sii.vendor_id, sc->vendor_id);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
#ifdef EC_IDENT_WILDCARDS
|
||||||
|
sc->product_code != 0xffffffff &&
|
||||||
|
#endif
|
||||||
|
slave->sii.product_code != sc->product_code
|
||||||
|
) {
|
||||||
|
EC_CONFIG_DBG(sc, 1, "Slave %u has no matching product code (0x%08X)"
|
||||||
|
" for configuration (0x%08X).\n",
|
||||||
|
slave->ring_position, slave->sii.product_code,
|
||||||
|
sc->product_code);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue