summaryrefslogtreecommitdiff
path: root/code/fe310/eos/msgq.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-05-17 04:03:23 +0200
committerUros Majstorovic <majstor@majstor.org>2020-05-17 04:03:23 +0200
commit75e57273a7ffded0ddcd3698ba68603c4be8a4cd (patch)
tree8b882cb41073ceadcdc5c27534a2dcc222adfb93 /code/fe310/eos/msgq.c
parent5d157b4f7ecea4793c9da5c33a890d4ea4afc545 (diff)
power management implemented; net protocol change
Diffstat (limited to 'code/fe310/eos/msgq.c')
-rw-r--r--code/fe310/eos/msgq.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/code/fe310/eos/msgq.c b/code/fe310/eos/msgq.c
index 07ea70f..e76090c 100644
--- a/code/fe310/eos/msgq.c
+++ b/code/fe310/eos/msgq.c
@@ -79,6 +79,10 @@ int eos_msgq_get(EOSMsgQ *msgq, unsigned char type, unsigned char *selector, uin
return 0;
}
+uint8_t eos_msgq_len(EOSMsgQ *msgq) {
+ return (uint8_t)(msgq->idx_w - msgq->idx_r);
+}
+
void eos_bufq_init(EOSBufQ *bufq, unsigned char **array, uint8_t size) {
bufq->idx_r = 0;
bufq->idx_w = 0;
@@ -99,3 +103,6 @@ unsigned char *eos_bufq_pop(EOSBufQ *bufq) {
return bufq->array[IDX_MASK(bufq->idx_r++, bufq->size)];
}
+uint8_t eos_bufq_len(EOSBufQ *bufq) {
+ return (uint8_t)(bufq->idx_w - bufq->idx_r);
+}