platform for developing on SQFMI's Watchy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

23 lines
375 B

#ifndef _QUEUE_h
#define _QUEUE_h
#include "watchos_types.h"
#define QUEUE_RING_SIZE 8
class Queue
{
private:
kernel_handle_t m_item[QUEUE_RING_SIZE];
int m_read = 0, m_write = 0;
bool m_full = false;
int next(int n);
public:
Queue();
void push(kernel_handle_t item);
kernel_handle_t pop();
kernel_handle_t peek();
bool isEmpty();
};
#endif