summaryrefslogtreecommitdiff
path: root/ports/nrf/bluetooth/ringbuffer.h
diff options
context:
space:
mode:
authormicroDev <70126934+microDev1@users.noreply.github.com>2021-03-15 19:27:36 +0530
committermicroDev <70126934+microDev1@users.noreply.github.com>2021-03-15 19:27:36 +0530
commita52eb88031620a81521b937f2a0651dbac2bb350 (patch)
tree017cbf8f686b252241182ef61ce48e8457aa1577 /ports/nrf/bluetooth/ringbuffer.h
parent090b6ba42fcdfbb16844f77892087f91aa6ea201 (diff)
run code formatting script
Diffstat (limited to 'ports/nrf/bluetooth/ringbuffer.h')
-rw-r--r--ports/nrf/bluetooth/ringbuffer.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/ports/nrf/bluetooth/ringbuffer.h b/ports/nrf/bluetooth/ringbuffer.h
index 9a06e7ccc..baf273293 100644
--- a/ports/nrf/bluetooth/ringbuffer.h
+++ b/ports/nrf/bluetooth/ringbuffer.h
@@ -65,18 +65,18 @@
#define _ringbuffer_h
#define ringBuffer_typedef(T, NAME) \
- typedef struct { \
- int size; \
- volatile int start; \
- volatile int end; \
- T* elems; \
- } NAME
+ typedef struct { \
+ int size; \
+ volatile int start; \
+ volatile int end; \
+ T *elems; \
+ } NAME
#define bufferInit(BUF, S, T) \
- BUF.size = S+1; \
- BUF.start = 0; \
- BUF.end = 0; \
- BUF.elems = (T*)calloc(BUF.size, sizeof(T))
+ BUF.size = S + 1; \
+ BUF.start = 0; \
+ BUF.end = 0; \
+ BUF.elems = (T *)calloc(BUF.size, sizeof(T))
#define bufferDestroy(BUF) free((BUF)->elems)
@@ -86,11 +86,11 @@
#define isBufferFull(BUF) (nextEndIndex(BUF) == (BUF)->start)
#define bufferWrite(BUF, ELEM) \
- (BUF)->elems[(BUF)->end] = ELEM; \
- (BUF)->end = ((BUF)->end + 1) % (BUF)->size; \
- if (isBufferEmpty(BUF)) { \
- (BUF)->start = nextStartIndex(BUF); \
- }
+ (BUF)->elems[(BUF)->end] = ELEM; \
+ (BUF)->end = ((BUF)->end + 1) % (BUF)->size; \
+ if (isBufferEmpty(BUF)) { \
+ (BUF)->start = nextStartIndex(BUF); \
+ }
#define bufferRead(BUF, ELEM) \
ELEM = (BUF)->elems[(BUF)->start]; \