59
59
DYNAMIXEL PROTOCOL 1.0 does NOT support Sync Read feature.
60
60
Structures containing the necessary information to process the 'fastSyncRead' packet.
61
61
62
- typedef struct XELInfoFastSyncRead {
63
- uint8_t *p_recv_buf;
64
- uint8_t id;
65
- uint8_t error;
66
- } __attribute__((packed)) XELInfoFastSyncRead_t ;
67
-
68
- typedef struct InfoFastSyncReadInst {
69
- uint16_t addr;
70
- uint16_t addr_length;
71
- XELInfoFastSyncRead_t * p_xels;
72
- uint8_t xel_count;
73
- bool is_info_changed;
74
- InfoSyncBulkBuffer_t packet;
75
- } __attribute__((packed)) InfoFastSyncReadInst_t ;
62
+ struct XELInfoSyncRead_t {
63
+ uint8_t *p_recv_buf;
64
+ uint8_t id;
65
+ uint8_t error;
66
+ } __attribute__((packed));
67
+
68
+ struct InfoSyncReadInst_t {
69
+ uint16_t addr;
70
+ uint16_t addr_length;
71
+ XELInfoSyncRead_t * p_xels;
72
+ uint8_t xel_count;
73
+ bool is_info_changed;
74
+ InfoSyncBulkBuffer_t packet;
75
+ } __attribute__((packed));
76
76
*/
77
77
78
78
/* syncWrite
79
79
DYNAMIXEL PROTOCOL 1.0 supports Control Table address up to 255.
80
80
Structures containing the necessary information to process the 'syncWrite' packet.
81
81
82
- typedef struct XELInfoSyncWrite {
82
+ struct XELInfoSyncWrite_t {
83
83
uint8_t* p_data;
84
84
uint8_t id;
85
- } __attribute__((packed)) XELInfoSyncWrite_t ;
85
+ } __attribute__((packed));
86
86
87
- typedef struct InfoSyncWriteInst {
87
+ struct InfoSyncWriteInst_t {
88
88
uint16_t addr;
89
89
uint16_t addr_length;
90
90
XELInfoSyncWrite_t* p_xels;
91
91
uint8_t xel_count;
92
92
bool is_info_changed;
93
93
InfoSyncBulkBuffer_t packet;
94
- } __attribute__((packed)) InfoSyncWriteInst_t ;
94
+ } __attribute__((packed));
95
95
*/
96
96
97
97
const float DYNAMIXEL_PROTOCOL_VERSION = 2.0 ;
@@ -115,8 +115,8 @@ typedef struct sw_data{
115
115
116
116
117
117
sr_data_t sr_data[DXL_ID_CNT];
118
- DYNAMIXEL::InfoFastSyncReadInst_t sr_infos;
119
- DYNAMIXEL::XELInfoFastSyncRead_t info_xels_sr[DXL_ID_CNT];
118
+ DYNAMIXEL::InfoSyncReadInst_t sr_infos;
119
+ DYNAMIXEL::XELInfoSyncRead_t info_xels_sr[DXL_ID_CNT];
120
120
121
121
sw_data_t sw_data[DXL_ID_CNT];
122
122
DYNAMIXEL::InfoSyncWriteInst_t sw_infos;
@@ -231,8 +231,10 @@ void loop() {
231
231
DEBUG_SERIAL.print (" [fastSyncRead] Success, Received ID Count: " );
232
232
DEBUG_SERIAL.println (recv_cnt);
233
233
for (i=0 ; i<recv_cnt; i++) {
234
- DEBUG_SERIAL.print (" ID: " );DEBUG_SERIAL.print (sr_infos.p_xels [i].id );
235
- DEBUG_SERIAL.print (" \t Present Position: " );DEBUG_SERIAL.println (sr_data[i].present_position );
234
+ DEBUG_SERIAL.print (" ID: " );
235
+ DEBUG_SERIAL.print (sr_infos.p_xels [i].id );
236
+ DEBUG_SERIAL.print (" \t Present Position: " );
237
+ DEBUG_SERIAL.println (sr_data[i].present_position );
236
238
}
237
239
} else {
238
240
DEBUG_SERIAL.print (" [fastSyncRead] Fail, Lib error code: " );
0 commit comments