Skip to content

Commit 3a54c46

Browse files
authored
Merge pull request #119 from ROBOTIS-GIT/develop
Release 0.6.2
2 parents 06c06f9 + e063bb9 commit 3a54c46

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Any contribution that you make to this repository will
2+
be under the Apache 2 License, as dictated by that
3+
[license](http://www.apache.org/licenses/LICENSE-2.0.html):
4+
5+
~~~
6+
5. Submission of Contributions. Unless You explicitly state otherwise,
7+
any Contribution intentionally submitted for inclusion in the Work
8+
by You to the Licensor shall be under the terms and conditions of
9+
this License, without any additional terms or conditions.
10+
Notwithstanding the above, nothing herein shall supersede or modify
11+
the terms of any separate license agreement you may have executed
12+
with Licensor regarding such Contributions.
13+
~~~
14+
15+
Contributors must sign-off each commit by adding a `Signed-off-by: ...`
16+
line to commit messages to certify that they have the right to submit
17+
the code they are contributing to the project according to the
18+
[Developer Certificate of Origin (DCO)](https://developercertificate.org/).

CONTRIBUTIONS.txt

Whitespace-only changes.

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Dynamixel2Arduino
2-
version=0.6.1
2+
version=0.6.2
33
author=ROBOTIS
44
license=Apache-2.0
55
maintainer=Will Son([email protected])

src/utility/config.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@
3333
#define ENABLE_ACTUATOR_PRO_RA 1
3434
#define ENABLE_ACTUATOR_PRO_PLUS 1
3535

36+
#define DXL_BYTE_STUFF_SAFE_CNT 8
37+
3638

3739
#if defined (ARDUINO_AVR_UNO) || defined (ARDUINO_AVR_YUN) \
3840
|| defined (ARDUINO_AVR_INDUSTRIAL101)
3941
#define DEFAULT_DXL_BUF_LENGTH 192
4042
#elif defined (ARDUINO_AVR_LEONARDO)
4143
#define DEFAULT_DXL_BUF_LENGTH 256
42-
#elif defined (OpenCR)
44+
#elif defined (__OPENCR__)
4345
#define DEFAULT_DXL_BUF_LENGTH 2048
4446
#else
4547
#define DEFAULT_DXL_BUF_LENGTH 1024
@@ -60,7 +62,7 @@
6062
#elif defined (ARDUINO_AVR_LEONARDO)
6163
#define DXL_MAX_NODE 16
6264
#define DXL_MAX_NODE_BUFFER_SIZE 12
63-
#elif defined (OpenCR)
65+
#elif defined (__OPENCR__)
6466
#define DXL_MAX_NODE 253 // Max number of XEL on DYNAMIXEL protocol
6567
#define DXL_MAX_NODE_BUFFER_SIZE 32
6668
#else

src/utility/slave.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Slave::Slave(DXLPortHandler &port, const uint16_t model_num, float protocol_ver)
2424
setPortProtocolVersion(protocol_ver);
2525
addDefaultControlItem();
2626

27-
p_packet_buf_ = new uint8_t[DEFAULT_DXL_BUF_LENGTH];
27+
p_packet_buf_ = new uint8_t[DEFAULT_DXL_BUF_LENGTH + DXL_BYTE_STUFF_SAFE_CNT];
2828
if(p_packet_buf_ != nullptr){
2929
packet_buf_capacity_ = DEFAULT_DXL_BUF_LENGTH;
3030
is_buf_malloced_ = true;
@@ -42,7 +42,7 @@ Slave::Slave(const uint16_t model_num, float protocol_ver)
4242
setPortProtocolVersion(protocol_ver);
4343
addDefaultControlItem();
4444

45-
p_packet_buf_ = new uint8_t[DEFAULT_DXL_BUF_LENGTH];
45+
p_packet_buf_ = new uint8_t[DEFAULT_DXL_BUF_LENGTH + DXL_BYTE_STUFF_SAFE_CNT];
4646
if(p_packet_buf_ != nullptr){
4747
packet_buf_capacity_ = DEFAULT_DXL_BUF_LENGTH;
4848
is_buf_malloced_ = true;
@@ -432,7 +432,7 @@ Slave::processInstRead()
432432
if(addr_length+11 > packet_buf_capacity_){
433433
err = DXL_LIB_ERROR_NOT_ENOUGH_BUFFER_SIZE;
434434
}
435-
p_tx_param = &p_packet_buf_[9];
435+
p_tx_param = &p_packet_buf_[9 + DXL_BYTE_STUFF_SAFE_CNT];
436436
}else{
437437
err = DXL_LIB_ERROR_WRONG_PACKET;
438438
}
@@ -443,7 +443,7 @@ Slave::processInstRead()
443443
if(addr_length+6 > packet_buf_capacity_){
444444
err = DXL_LIB_ERROR_NOT_ENOUGH_BUFFER_SIZE;
445445
}
446-
p_tx_param = &p_packet_buf_[5];
446+
p_tx_param = &p_packet_buf_[5 + DXL_BYTE_STUFF_SAFE_CNT];
447447
}else{
448448
err = DXL_LIB_ERROR_WRONG_PACKET;
449449
}

0 commit comments

Comments
 (0)