Ring buffer fixes and spark time compute
This commit is contained in:
1 parent
42e64b673c
commit
e346c67e00
4 files changed
+16
-7
No files matched your search
@@ -6,17 +6,17 @@
|
||||
#include <ring_buffer.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
void ringBufferPush(ring_buffer_t *rb, uint32_t value) {
|
||||
void ringBufferPush(volatile ring_buffer_t *rb, uint32_t value) {
|
||||
rb->buffer[rb->w_head] = value;
|
||||
rb->w_head++;
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t ringBufferRead(ring_buffer_t *rb, uint8_t idx) {
|
||||
return rb->buffer[rb->w_head - 1 - idx];
|
||||
uint32_t ringBufferRead(volatile ring_buffer_t *rb, uint8_t neg_idx) {
|
||||
return rb->buffer[rb->w_head - 1 - neg_idx];
|
||||
}
|
||||
|
||||
void ringBufferRevert(ring_buffer_t *rb, uint8_t val) {
|
||||
void ringBufferRevert(volatile ring_buffer_t *rb, uint8_t val) {
|
||||
rb->w_head -= val;
|
||||
return;
|
||||
}
|
||||
Reference in new issue
Block a user