diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-08-27 17:06:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-27 17:06:45 -0400 |
commit | 4fd5ac8326f491a347b8c049f32a3353a633ebf5 (patch) | |
tree | c82d8b5325ea82a7544489022afe00bf909495c3 /quantum/serial_link/protocol/transport.h | |
parent | f815b4871ebc5cc2f8d1a306eceec68c0a973a4c (diff) | |
parent | 922c4ea3bc46f6246d9f67ead11bcf53ff947ef3 (diff) | |
download | qmk_firmware-4fd5ac8326f491a347b8c049f32a3353a633ebf5.tar.gz qmk_firmware-4fd5ac8326f491a347b8c049f32a3353a633ebf5.zip |
Merge pull request #690 from fredizzimo/unit_test
Add Unit Testing support
Diffstat (limited to 'quantum/serial_link/protocol/transport.h')
-rw-r--r-- | quantum/serial_link/protocol/transport.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/quantum/serial_link/protocol/transport.h b/quantum/serial_link/protocol/transport.h index 9a052d8809..2c5d890b21 100644 --- a/quantum/serial_link/protocol/transport.h +++ b/quantum/serial_link/protocol/transport.h @@ -82,7 +82,7 @@ typedef struct { \ remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - return triple_buffer_read_internal(obj->object_size, tb); \ + return (type*)triple_buffer_read_internal(obj->object_size, tb); \ } #define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \ @@ -112,7 +112,7 @@ typedef struct { \ remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ uint8_t* start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size);\ triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - return triple_buffer_read_internal(obj->object_size, tb); \ + return (type*)triple_buffer_read_internal(obj->object_size, tb); \ } #define SLAVE_TO_MASTER_OBJECT(name, type) \ @@ -139,12 +139,13 @@ typedef struct { \ uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ start+=slave * REMOTE_OBJECT_SIZE(obj->object_size); \ triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - return triple_buffer_read_internal(obj->object_size, tb); \ + return (type*)triple_buffer_read_internal(obj->object_size, tb); \ } #define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name void add_remote_objects(remote_object_t** remote_objects, uint32_t num_remote_objects); +void reinitialize_serial_link_transport(void); void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); void update_transport(void); |