aboutsummaryrefslogtreecommitdiff
path: root/pdl/common/pdl_channel.c
blob: 313535423c3c35242ae3f466d2453576f18fb66b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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;
}