Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stm32_libraries
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
humanoides
tools
stm32_libraries
Commits
da01cee2
Commit
da01cee2
authored
9 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Changed some 8 bit control variables to 16 bit variables in the version 2 protocol.
parent
817eaecb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dynamixel_base/src/dynamixel2.c
+10
-14
10 additions, 14 deletions
dynamixel_base/src/dynamixel2.c
with
10 additions
and
14 deletions
dynamixel_base/src/dynamixel2.c
+
10
−
14
View file @
da01cee2
...
@@ -94,7 +94,7 @@ inline TDynInstruction dyn2_get_instruction(unsigned char *packet)
...
@@ -94,7 +94,7 @@ inline TDynInstruction dyn2_get_instruction(unsigned char *packet)
unsigned
char
dyn2_convert_v1_inst_packet
(
unsigned
char
*
source
,
unsigned
char
*
destination
)
unsigned
char
dyn2_convert_v1_inst_packet
(
unsigned
char
*
source
,
unsigned
char
*
destination
)
{
{
unsigned
char
i
;
unsigned
short
int
i
;
destination
[
DYN2_HEADER_OFF
]
=
0xFF
;
destination
[
DYN2_HEADER_OFF
]
=
0xFF
;
destination
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
destination
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
...
@@ -193,7 +193,7 @@ unsigned short int dyn2_get_write_data(unsigned char *packet,unsigned char *data
...
@@ -193,7 +193,7 @@ unsigned short int dyn2_get_write_data(unsigned char *packet,unsigned char *data
/* registered write instruction */
/* registered write instruction */
void
dyn2_init_reg_write_packet
(
unsigned
char
*
packet
,
unsigned
char
id
,
unsigned
short
int
address
,
unsigned
short
int
length
,
unsigned
char
*
data
)
void
dyn2_init_reg_write_packet
(
unsigned
char
*
packet
,
unsigned
char
id
,
unsigned
short
int
address
,
unsigned
short
int
length
,
unsigned
char
*
data
)
{
{
unsigned
short
int
i
;
unsigned
short
int
i
;
packet
[
DYN2_HEADER_OFF
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
...
@@ -220,7 +220,7 @@ inline unsigned short int dyn2_get_reg_write_length(unsigned char *packet)
...
@@ -220,7 +220,7 @@ inline unsigned short int dyn2_get_reg_write_length(unsigned char *packet)
unsigned
short
int
dyn2_get_reg_write_data
(
unsigned
char
*
packet
,
unsigned
char
*
data
)
unsigned
short
int
dyn2_get_reg_write_data
(
unsigned
char
*
packet
,
unsigned
char
*
data
)
{
{
unsigned
char
i
,
length
;
unsigned
short
int
i
,
length
;
length
=
dyn2_get_reg_write_length
(
packet
);
length
=
dyn2_get_reg_write_length
(
packet
);
for
(
i
=
0
;
i
<
length
;
i
++
)
for
(
i
=
0
;
i
<
length
;
i
++
)
...
@@ -261,7 +261,8 @@ void dyn2_init_reset_packet(unsigned char *packet,unsigned char id,unsigned char
...
@@ -261,7 +261,8 @@ void dyn2_init_reset_packet(unsigned char *packet,unsigned char id,unsigned char
/* sync write instruction */
/* sync write instruction */
void
dyn2_init_sync_write_packet
(
unsigned
char
*
packet
,
unsigned
char
num_servos
,
unsigned
char
*
servo_ids
,
unsigned
short
int
address
,
unsigned
short
int
length
,
TWriteData
*
data
)
void
dyn2_init_sync_write_packet
(
unsigned
char
*
packet
,
unsigned
char
num_servos
,
unsigned
char
*
servo_ids
,
unsigned
short
int
address
,
unsigned
short
int
length
,
TWriteData
*
data
)
{
{
unsigned
char
i
,
j
;
unsigned
char
i
;
unsigned
short
int
j
;
packet
[
DYN2_HEADER_OFF
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
...
@@ -381,8 +382,8 @@ unsigned char dyn2_bulk_read_id_present(unsigned char *packet,unsigned char id,u
...
@@ -381,8 +382,8 @@ unsigned char dyn2_bulk_read_id_present(unsigned char *packet,unsigned char id,u
/* bulk write instruction */
/* bulk write instruction */
void
dyn2_init_bulk_write_packet
(
unsigned
char
*
packet
,
unsigned
char
num_servos
,
unsigned
char
*
servo_ids
,
unsigned
short
int
*
address
,
unsigned
short
int
*
length
,
TWriteData
*
data
)
void
dyn2_init_bulk_write_packet
(
unsigned
char
*
packet
,
unsigned
char
num_servos
,
unsigned
char
*
servo_ids
,
unsigned
short
int
*
address
,
unsigned
short
int
*
length
,
TWriteData
*
data
)
{
{
unsigned
char
i
,
j
;
unsigned
char
i
;
unsigned
short
int
total_length
=
0
;
unsigned
short
int
total_length
=
0
,
j
;
packet
[
DYN2_HEADER_OFF
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
...
@@ -432,7 +433,7 @@ unsigned char dyn2_bulk_write_id_present(unsigned char *packet,unsigned char id,
...
@@ -432,7 +433,7 @@ unsigned char dyn2_bulk_write_id_present(unsigned char *packet,unsigned char id,
/* status packet */
/* status packet */
unsigned
char
dyn2_convert_v1_status_packet
(
TDynInstruction
inst
,
unsigned
char
*
source
,
unsigned
char
*
destination
)
unsigned
char
dyn2_convert_v1_status_packet
(
TDynInstruction
inst
,
unsigned
char
*
source
,
unsigned
char
*
destination
)
{
{
unsigned
char
i
;
unsigned
short
int
i
;
destination
[
DYN2_HEADER_OFF
]
=
0xFF
;
destination
[
DYN2_HEADER_OFF
]
=
0xFF
;
destination
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
destination
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
...
@@ -452,7 +453,7 @@ unsigned char dyn2_convert_v1_status_packet(TDynInstruction inst,unsigned char *
...
@@ -452,7 +453,7 @@ unsigned char dyn2_convert_v1_status_packet(TDynInstruction inst,unsigned char *
void
dyn2_init_status_packet
(
unsigned
char
*
packet
,
unsigned
char
id
,
TDynError
error
,
unsigned
short
int
length
,
unsigned
char
*
data
)
void
dyn2_init_status_packet
(
unsigned
char
*
packet
,
unsigned
char
id
,
TDynError
error
,
unsigned
short
int
length
,
unsigned
char
*
data
)
{
{
unsigned
char
i
;
unsigned
short
int
i
;
packet
[
DYN2_HEADER_OFF
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
packet
[
DYN2_HEADER_OFF
+
1
]
=
0xFF
;
...
@@ -475,7 +476,7 @@ inline TDynError dyn2_get_status_error(unsigned char *packet)
...
@@ -475,7 +476,7 @@ inline TDynError dyn2_get_status_error(unsigned char *packet)
/* read instruction status packet */
/* read instruction status packet */
unsigned
short
int
dyn2_get_read_status_data
(
unsigned
char
*
packet
,
unsigned
char
*
data
)
unsigned
short
int
dyn2_get_read_status_data
(
unsigned
char
*
packet
,
unsigned
char
*
data
)
{
{
unsigned
char
i
,
length
;
unsigned
short
int
i
,
length
;
length
=*
((
unsigned
short
int
*
)
&
packet
[
DYN2_LENGTH_OFF
])
-
4
;
length
=*
((
unsigned
short
int
*
)
&
packet
[
DYN2_LENGTH_OFF
])
-
4
;
for
(
i
=
0
;
i
<
length
;
i
++
)
for
(
i
=
0
;
i
<
length
;
i
++
)
...
@@ -483,8 +484,3 @@ unsigned short int dyn2_get_read_status_data(unsigned char *packet,unsigned char
...
@@ -483,8 +484,3 @@ unsigned short int dyn2_get_read_status_data(unsigned char *packet,unsigned char
return
length
;
return
length
;
}
}
inline
unsigned
char
dyn2_get_read_status_id
(
unsigned
char
*
packet
)
{
return
packet
[
DYN2_ID_OFF
];
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment