aboutsummaryrefslogtreecommitdiff
path: root/pdl/common/pdl_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'pdl/common/pdl_channel.c')
-rw-r--r--pdl/common/pdl_channel.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/pdl/common/pdl_channel.c b/pdl/common/pdl_channel.c
new file mode 100644
index 0000000000..313535423c
--- /dev/null
+++ b/pdl/common/pdl_channel.c
@@ -0,0 +1,39 @@
+
+#include "pdl_channel.h"
+#include "pdl_debug.h"
+
+static struct pdl_channel *serial_channel = NULL;
+
+void pdl_channel_register(struct pdl_channel *channel)
+{
+ if (channel) {
+ serial_channel = channel;
+ } else {
+ pdl_error("channel cannot register\n");
+ }
+
+ return;
+}
+
+struct pdl_channel *pdl_get_channel(void)
+{
+ return serial_channel;
+}
+
+static struct pdl_channel *debug_channel = NULL;
+
+void pdl_debug_channel_register(struct pdl_channel *channel)
+{
+ if (channel) {
+ debug_channel = channel;
+ } else {
+ pdl_error("debug channel cannot register\n");
+ }
+
+ return;
+}
+
+struct pdl_channel *pdl_get_debug_channel(void)
+{
+ return debug_channel;
+}