From 83abb81e61beec213f9f83843d6fab637a578f4a Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 23 Jul 2019 10:13:38 -0700 Subject: rfnoc: actions: Allow sending actions to self Sending actions to self is useful because calling post_action() from within an action handler will not actually trigger the action. Instead, it will defer delivery of the action. Allowing sending actions to self will allow to add another action, in deterministic order, and the execution of another action handler. --- host/lib/rfnoc/node.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'host/lib/rfnoc/node.cpp') diff --git a/host/lib/rfnoc/node.cpp b/host/lib/rfnoc/node.cpp index d97588bab..8709df9ef 100644 --- a/host/lib/rfnoc/node.cpp +++ b/host/lib/rfnoc/node.cpp @@ -495,6 +495,12 @@ void node_t::receive_action(const res_source_info& src_info, action_info::sptr a return; } + // We won't forward actions if they were for us + if (src_info.type == res_source_info::USER) { + RFNOC_LOG_TRACE("Dropping USER action " << action->key << "#" << action->id); + return; + } + // Otherwise, we need to figure out the correct default action handling: const auto fwd_policy = [&](const std::string& id) { if (_action_fwd_policies.count(id)) { -- cgit v1.2.3