Commit efe3cf72 authored by Cesar Prados's avatar Cesar Prados Committed by Alessandro Rubini

pdelay/fsm: add a new function, pclock, for the slave state in the fsm

Depending the link delay mechanism the slave executes pp_slave
or pp_pclock. This is achieve making use of #ifdef during compilation,
which I don't like but for the time being it's going to be like this.
Signed-off-by: Cesar Prados's avatarC.Prados <c.prados@gsi.de>
parent 5e2d1b36
......@@ -77,6 +77,12 @@ ifneq ($(PROTO_EXT),)
endif
include proto-standard/Makefile
ifeq ($(CONFIG_E2E),y)
CFLAGS += -DCONFIG_E2E
else
CFLAGS += -DCONFIG_P2P
endif
# ...and the TIME choice sets the default operations
CFLAGS += -DDEFAULT_TIME_OPS=$(TIME)_time_ops
CFLAGS += -DDEFAULT_NET_OPS=$(TIME)_net_ops
......
......@@ -450,7 +450,7 @@ extern struct pp_state_table_item pp_state_table[]; /* 0-terminated */
/* Standard state-machine functions */
extern pp_action pp_initializing, pp_faulty, pp_disabled, pp_listening,
pp_pre_master, pp_master, pp_passive, pp_uncalibrated,
pp_slave;
pp_slave, pp_pclock;;
/* The engine */
extern int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen);
......
......@@ -21,7 +21,11 @@ struct pp_state_table_item pp_state_table[] = {
{ PPS_MASTER, "master", pp_master,},
/*{ PPS_PASSIVE, "passive", pp_passive,},*/
{ PPS_UNCALIBRATED, "uncalibrated", pp_uncalibrated,},
#ifdef CONFIG_E2E
{ PPS_SLAVE, "slave", pp_slave,},
#elif CONFIG_P2P
{ PPS_SLAVE, "slave", pp_pclock,},
#endif
{ WRS_PRESENT, "uncalibrated/wr-present", wr_present,},
{ WRS_M_LOCK, "master/wr-m-lock", wr_m_lock,},
{ WRS_S_LOCK, "uncalibrated/wr-s-lock", wr_s_lock,},
......
......@@ -22,6 +22,10 @@ struct pp_state_table_item pp_state_table[] __attribute__((weak)) = {
{ PPS_MASTER, "master", pp_master,},
{ PPS_PASSIVE, "passive", pp_passive,},
{ PPS_UNCALIBRATED, "uncalibrated", pp_uncalibrated,},
#ifdef CONFIG_E2E
{ PPS_SLAVE, "slave", pp_slave,},
#elif CONFIG_P2P
{ PPS_SLAVE, "slave", pp_pclock,},
#endif
{ PPS_END_OF_TABLE,}
};
Markdown is supported
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