Initial queue unit test

This commit is contained in:
Ed
2024-04-17 15:12:41 +01:00
parent 540fb4baa5
commit 36b32a36db
7 changed files with 240 additions and 3 deletions

View File

@@ -14,6 +14,8 @@ typedef struct queue_t {
unsigned mask;
} queue_t;
#ifdef __XC__
inline int is_power_of_2(unsigned x) {
return x != 0 && (x & (x - 1)) == 0;
}
@@ -64,4 +66,6 @@ inline unsigned queue_space(const queue_t &q) {
return q.size - queue_items(q);
}
#endif // __XC__
#endif /* QUEUE_H_ */