diff options
author | William Chang <william@factual.com> | 2019-11-20 22:17:07 -0800 |
---|---|---|
committer | William Chang <william@factual.com> | 2019-11-20 22:17:07 -0800 |
commit | e7f4d56592b3975c38af329e77b4efd9108495e8 (patch) | |
tree | 0a416bccbf70bfdbdb9ffcdb3bf136b47378c014 /quantum/serial_link/protocol/triple_buffered_object.h | |
parent | 71493b2f9bbd5f3d18373c518fa14ccafcbf48fc (diff) | |
parent | 8416a94ad27b3ff058576f09f35f0704a8b39ff3 (diff) | |
download | qmk_firmware-e7f4d56592b3975c38af329e77b4efd9108495e8.tar.gz |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'quantum/serial_link/protocol/triple_buffered_object.h')
-rw-r--r-- | quantum/serial_link/protocol/triple_buffered_object.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/quantum/serial_link/protocol/triple_buffered_object.h b/quantum/serial_link/protocol/triple_buffered_object.h index 2e57db3f5..6ec98d52b 100644 --- a/quantum/serial_link/protocol/triple_buffered_object.h +++ b/quantum/serial_link/protocol/triple_buffered_object.h @@ -30,22 +30,18 @@ SOFTWARE. typedef struct { uint8_t state; uint8_t buffer[] __attribute__((aligned(4))); -}triple_buffer_object_t; +} triple_buffer_object_t; void triple_buffer_init(triple_buffer_object_t* object); -#define triple_buffer_begin_write(object) \ - (typeof(*object.buffer[0])*)triple_buffer_begin_write_internal(sizeof(*object.buffer[0]), (triple_buffer_object_t*)object) +#define triple_buffer_begin_write(object) (typeof(*object.buffer[0])*)triple_buffer_begin_write_internal(sizeof(*object.buffer[0]), (triple_buffer_object_t*)object) -#define triple_buffer_end_write(object) \ - triple_buffer_end_write_internal((triple_buffer_object_t*)object) +#define triple_buffer_end_write(object) triple_buffer_end_write_internal((triple_buffer_object_t*)object) -#define triple_buffer_read(object) \ - (typeof(*object.buffer[0])*)triple_buffer_read_internal(sizeof(*object.buffer[0]), (triple_buffer_object_t*)object) +#define triple_buffer_read(object) (typeof(*object.buffer[0])*)triple_buffer_read_internal(sizeof(*object.buffer[0]), (triple_buffer_object_t*)object) void* triple_buffer_begin_write_internal(uint16_t object_size, triple_buffer_object_t* object); -void triple_buffer_end_write_internal(triple_buffer_object_t* object); +void triple_buffer_end_write_internal(triple_buffer_object_t* object); void* triple_buffer_read_internal(uint16_t object_size, triple_buffer_object_t* object); - #endif |