From 75e57273a7ffded0ddcd3698ba68603c4be8a4cd Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 17 May 2020 04:03:23 +0200 Subject: power management implemented; net protocol change --- code/fe310/eos/msgq.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'code/fe310/eos/msgq.c') 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); +} -- cgit v1.2.3