diff options
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 9a052d880..2c5d890b2 100644 --- a/quantum/serial_link/protocol/transport.h +++ b/quantum/serial_link/protocol/transport.h | |||
@@ -82,7 +82,7 @@ typedef struct { \ | |||
82 | remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ | 82 | remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ |
83 | uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ | 83 | uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ |
84 | triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ | 84 | triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ |
85 | return triple_buffer_read_internal(obj->object_size, tb); \ | 85 | return (type*)triple_buffer_read_internal(obj->object_size, tb); \ |
86 | } | 86 | } |
87 | 87 | ||
88 | #define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \ | 88 | #define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \ |
@@ -112,7 +112,7 @@ typedef struct { \ | |||
112 | remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ | 112 | remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ |
113 | uint8_t* start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size);\ | 113 | uint8_t* start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size);\ |
114 | triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ | 114 | triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ |
115 | return triple_buffer_read_internal(obj->object_size, tb); \ | 115 | return (type*)triple_buffer_read_internal(obj->object_size, tb); \ |
116 | } | 116 | } |
117 | 117 | ||
118 | #define SLAVE_TO_MASTER_OBJECT(name, type) \ | 118 | #define SLAVE_TO_MASTER_OBJECT(name, type) \ |
@@ -139,12 +139,13 @@ typedef struct { \ | |||
139 | uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ | 139 | uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ |
140 | start+=slave * REMOTE_OBJECT_SIZE(obj->object_size); \ | 140 | start+=slave * REMOTE_OBJECT_SIZE(obj->object_size); \ |
141 | triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ | 141 | triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ |
142 | return triple_buffer_read_internal(obj->object_size, tb); \ | 142 | return (type*)triple_buffer_read_internal(obj->object_size, tb); \ |
143 | } | 143 | } |
144 | 144 | ||
145 | #define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name | 145 | #define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name |
146 | 146 | ||
147 | void add_remote_objects(remote_object_t** remote_objects, uint32_t num_remote_objects); | 147 | void add_remote_objects(remote_object_t** remote_objects, uint32_t num_remote_objects); |
148 | void reinitialize_serial_link_transport(void); | ||
148 | void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); | 149 | void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); |
149 | void update_transport(void); | 150 | void update_transport(void); |
150 | 151 | ||