aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/device_id.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/rfnoc/device_id.cpp')
-rw-r--r--host/lib/rfnoc/device_id.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/host/lib/rfnoc/device_id.cpp b/host/lib/rfnoc/device_id.cpp
new file mode 100644
index 000000000..6bd287dce
--- /dev/null
+++ b/host/lib/rfnoc/device_id.cpp
@@ -0,0 +1,17 @@
+//
+// Copyright 2019 Ettus Research, a National Instruments Brand
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+
+#include <uhdlib/rfnoc/device_id.hpp>
+#include <atomic>
+
+using namespace uhd::rfnoc;
+
+device_id_t uhd::rfnoc::allocate_device_id()
+{
+ static std::atomic<device_id_t> counter{1};
+ return counter++;
+}
+