summaryrefslogtreecommitdiff
path: root/usb-i2c-sl018/eventqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'usb-i2c-sl018/eventqueue.c')
-rw-r--r--usb-i2c-sl018/eventqueue.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usb-i2c-sl018/eventqueue.c b/usb-i2c-sl018/eventqueue.c
index af6d9f7..53f60d5 100644
--- a/usb-i2c-sl018/eventqueue.c
+++ b/usb-i2c-sl018/eventqueue.c
@@ -27,17 +27,20 @@
static RingBuffer_t event_queue;
static uint8_t event_queue_data[128];
-void eventqueue_init(void)
+void init_eventqueue(void)
{
RingBuffer_InitBuffer(&event_queue, event_queue_data, sizeof(event_queue_data));
}
event_t eventqueue_pop(void)
{
- return none;
+ if (RingBuffer_IsEmpty(&event_queue))
+ return none;
+ return RingBuffer_Remove(&event_queue);
}
void eventqueue_push(event_t event)
{
+ RingBuffer_Insert(&event_queue,event);
}