merge.
This commit is contained in:
commit
1614cb06bd
1
TODO
1
TODO
|
|
@ -43,6 +43,7 @@ Version 1.5.0:
|
|||
* Fix casting away constness during expected WC calculation.
|
||||
* Read AL status code on spontaneous state change.
|
||||
* Fix clearing domains etc. when not activated and releasing.
|
||||
* Only output watchdog config if not default.
|
||||
|
||||
Future issues:
|
||||
|
||||
|
|
|
|||
24
configure.ac
24
configure.ac
|
|
@ -512,6 +512,30 @@ if test "x${hrtimer}" = "x1"; then
|
|||
AC_DEFINE([EC_USE_HRTIMER], [1], [Use hrtimer for scheduling])
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Read alias address from register
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
AC_ARG_ENABLE([regalias],
|
||||
AS_HELP_STRING([--enable-regalias],
|
||||
[Read alias adresses from register (default: no)]),
|
||||
[
|
||||
case "${enableval}" in
|
||||
yes) regalias=1
|
||||
;;
|
||||
no) regalias=0
|
||||
;;
|
||||
*) AC_MSG_ERROR([Invalid value for --enable-regalias])
|
||||
;;
|
||||
esac
|
||||
],
|
||||
[regalias=0]
|
||||
)
|
||||
|
||||
if test "x${regalias}" = "x1"; then
|
||||
AC_DEFINE([EC_REGALIAS], [1], [Read alias adresses from register])
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Command-line tool
|
||||
#-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ static cycles_t t_last_cycle = 0, t_critical;
|
|||
// process data
|
||||
static uint8_t *domain1_pd; // process data memory
|
||||
|
||||
#define AnaInSlavePos 0, 1
|
||||
#define DigOutSlavePos 0, 3
|
||||
#define AnaInSlavePos 0, 3
|
||||
#define DigOutSlavePos 0, 2
|
||||
|
||||
#define Beckhoff_EL2004 0x00000002, 0x07D43052
|
||||
#define Beckhoff_EL3162 0x00000002, 0x0C5A3052
|
||||
|
|
@ -286,8 +286,8 @@ int __init init_mod(void)
|
|||
t_critical = cpu_khz * 1000 / FREQUENCY - cpu_khz * INHIBIT_TIME / 1000;
|
||||
|
||||
master = ecrt_request_master(0);
|
||||
if (IS_ERR(master)) {
|
||||
ret = PTR_ERR(master);
|
||||
if (!master) {
|
||||
ret = -EBUSY;
|
||||
printk(KERN_ERR PFX "Requesting master 0 failed!\n");
|
||||
goto out_return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ void ec_fsm_slave_scan_state_dc_times(ec_fsm_slave_scan_t *);
|
|||
void ec_fsm_slave_scan_state_datalink(ec_fsm_slave_scan_t *);
|
||||
void ec_fsm_slave_scan_state_sii_size(ec_fsm_slave_scan_t *);
|
||||
void ec_fsm_slave_scan_state_sii_data(ec_fsm_slave_scan_t *);
|
||||
#ifdef EC_REGALIAS
|
||||
void ec_fsm_slave_scan_state_regalias(ec_fsm_slave_scan_t *);
|
||||
#endif
|
||||
void ec_fsm_slave_scan_state_preop(ec_fsm_slave_scan_t *);
|
||||
void ec_fsm_slave_scan_state_sync(ec_fsm_slave_scan_t *);
|
||||
void ec_fsm_slave_scan_state_pdos(ec_fsm_slave_scan_t *);
|
||||
|
|
@ -61,7 +63,9 @@ void ec_fsm_slave_scan_state_end(ec_fsm_slave_scan_t *);
|
|||
void ec_fsm_slave_scan_state_error(ec_fsm_slave_scan_t *);
|
||||
|
||||
void ec_fsm_slave_scan_enter_datalink(ec_fsm_slave_scan_t *);
|
||||
#ifdef EC_REGALIAS
|
||||
void ec_fsm_slave_scan_enter_regalias(ec_fsm_slave_scan_t *);
|
||||
#endif
|
||||
void ec_fsm_slave_scan_enter_preop(ec_fsm_slave_scan_t *);
|
||||
void ec_fsm_slave_scan_enter_pdos(ec_fsm_slave_scan_t *);
|
||||
|
||||
|
|
@ -694,7 +698,15 @@ void ec_fsm_slave_scan_state_sii_data(ec_fsm_slave_scan_t *fsm /**< slave state
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef EC_REGALIAS
|
||||
ec_fsm_slave_scan_enter_regalias(fsm);
|
||||
#else
|
||||
if (slave->sii.mailbox_protocols & EC_MBOX_COE) {
|
||||
ec_fsm_slave_scan_enter_preop(fsm);
|
||||
} else {
|
||||
fsm->state = ec_fsm_slave_scan_state_end;
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
|
||||
end:
|
||||
|
|
@ -703,13 +715,12 @@ end:
|
|||
fsm->state = ec_fsm_slave_scan_state_error;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
Slave scan entry function: REGALIAS.
|
||||
*/
|
||||
#ifdef EC_REGALIAS
|
||||
|
||||
/** Slave scan entry function: REGALIAS.
|
||||
*/
|
||||
void ec_fsm_slave_scan_enter_regalias(
|
||||
ec_fsm_slave_scan_t *fsm /**< slave state machine */
|
||||
)
|
||||
|
|
@ -727,9 +738,8 @@ void ec_fsm_slave_scan_enter_regalias(
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
Slave scan state: REGALIAS.
|
||||
*/
|
||||
/** Slave scan state: REGALIAS.
|
||||
*/
|
||||
void ec_fsm_slave_scan_state_regalias(
|
||||
ec_fsm_slave_scan_t *fsm /**< slave state machine */
|
||||
)
|
||||
|
|
@ -754,6 +764,7 @@ void ec_fsm_slave_scan_state_regalias(
|
|||
EC_SLAVE_DBG(slave, 1, "Read alias %u from register.\n",
|
||||
slave->effective_alias);
|
||||
}
|
||||
|
||||
if (slave->sii.mailbox_protocols & EC_MBOX_COE) {
|
||||
ec_fsm_slave_scan_enter_preop(fsm);
|
||||
} else {
|
||||
|
|
@ -761,6 +772,8 @@ void ec_fsm_slave_scan_state_regalias(
|
|||
}
|
||||
}
|
||||
|
||||
#endif // defined EC_REGALIAS
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/** Enter slave scan state PREOP.
|
||||
|
|
|
|||
|
|
@ -687,6 +687,12 @@ void ecrt_slave_config_dc(ec_slave_config_t *sc, uint16_t assign_activate,
|
|||
uint32_t sync0_cycle_time, uint32_t sync0_shift_time,
|
||||
uint32_t sync1_cycle_time, uint32_t sync1_shift_time)
|
||||
{
|
||||
EC_CONFIG_DBG(sc, 1, "%s(sc = 0x%p, assign_activate = 0x%04X,"
|
||||
" sync0_cycle = %u, sync0_shift = %u,"
|
||||
" sync1_cycle = %u, sync1_shift = %u\n",
|
||||
__func__, sc, assign_activate, sync0_cycle_time, sync0_shift_time,
|
||||
sync1_cycle_time, sync1_shift_time);
|
||||
|
||||
sc->dc_assign_activate = assign_activate;
|
||||
sc->dc_sync[0].cycle_time = sync0_cycle_time;
|
||||
sc->dc_sync[0].shift_time = sync0_shift_time;
|
||||
|
|
|
|||
Loading…
Reference in New Issue