Skip to content

Commit

Permalink
Merge pull request #119 from ROBOTIS-GIT/develop
Browse files Browse the repository at this point in the history
Release 0.6.2
  • Loading branch information
ROBOTIS-Will authored Jan 27, 2023
2 parents 06c06f9 + e063bb9 commit 3a54c46
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Any contribution that you make to this repository will
be under the Apache 2 License, as dictated by that
[license](http://www.apache.org/licenses/LICENSE-2.0.html):

~~~
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
~~~

Contributors must sign-off each commit by adding a `Signed-off-by: ...`
line to commit messages to certify that they have the right to submit
the code they are contributing to the project according to the
[Developer Certificate of Origin (DCO)](https://developercertificate.org/).
Empty file removed CONTRIBUTIONS.txt
Empty file.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Dynamixel2Arduino
version=0.6.1
version=0.6.2
author=ROBOTIS
license=Apache-2.0
maintainer=Will Son([email protected])
Expand Down
6 changes: 4 additions & 2 deletions src/utility/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
#define ENABLE_ACTUATOR_PRO_RA 1
#define ENABLE_ACTUATOR_PRO_PLUS 1

#define DXL_BYTE_STUFF_SAFE_CNT 8


#if defined (ARDUINO_AVR_UNO) || defined (ARDUINO_AVR_YUN) \
|| defined (ARDUINO_AVR_INDUSTRIAL101)
#define DEFAULT_DXL_BUF_LENGTH 192
#elif defined (ARDUINO_AVR_LEONARDO)
#define DEFAULT_DXL_BUF_LENGTH 256
#elif defined (OpenCR)
#elif defined (__OPENCR__)
#define DEFAULT_DXL_BUF_LENGTH 2048
#else
#define DEFAULT_DXL_BUF_LENGTH 1024
Expand All @@ -60,7 +62,7 @@
#elif defined (ARDUINO_AVR_LEONARDO)
#define DXL_MAX_NODE 16
#define DXL_MAX_NODE_BUFFER_SIZE 12
#elif defined (OpenCR)
#elif defined (__OPENCR__)
#define DXL_MAX_NODE 253 // Max number of XEL on DYNAMIXEL protocol
#define DXL_MAX_NODE_BUFFER_SIZE 32
#else
Expand Down
8 changes: 4 additions & 4 deletions src/utility/slave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Slave::Slave(DXLPortHandler &port, const uint16_t model_num, float protocol_ver)
setPortProtocolVersion(protocol_ver);
addDefaultControlItem();

p_packet_buf_ = new uint8_t[DEFAULT_DXL_BUF_LENGTH];
p_packet_buf_ = new uint8_t[DEFAULT_DXL_BUF_LENGTH + DXL_BYTE_STUFF_SAFE_CNT];
if(p_packet_buf_ != nullptr){
packet_buf_capacity_ = DEFAULT_DXL_BUF_LENGTH;
is_buf_malloced_ = true;
Expand All @@ -42,7 +42,7 @@ Slave::Slave(const uint16_t model_num, float protocol_ver)
setPortProtocolVersion(protocol_ver);
addDefaultControlItem();

p_packet_buf_ = new uint8_t[DEFAULT_DXL_BUF_LENGTH];
p_packet_buf_ = new uint8_t[DEFAULT_DXL_BUF_LENGTH + DXL_BYTE_STUFF_SAFE_CNT];
if(p_packet_buf_ != nullptr){
packet_buf_capacity_ = DEFAULT_DXL_BUF_LENGTH;
is_buf_malloced_ = true;
Expand Down Expand Up @@ -432,7 +432,7 @@ Slave::processInstRead()
if(addr_length+11 > packet_buf_capacity_){
err = DXL_LIB_ERROR_NOT_ENOUGH_BUFFER_SIZE;
}
p_tx_param = &p_packet_buf_[9];
p_tx_param = &p_packet_buf_[9 + DXL_BYTE_STUFF_SAFE_CNT];
}else{
err = DXL_LIB_ERROR_WRONG_PACKET;
}
Expand All @@ -443,7 +443,7 @@ Slave::processInstRead()
if(addr_length+6 > packet_buf_capacity_){
err = DXL_LIB_ERROR_NOT_ENOUGH_BUFFER_SIZE;
}
p_tx_param = &p_packet_buf_[5];
p_tx_param = &p_packet_buf_[5 + DXL_BYTE_STUFF_SAFE_CNT];
}else{
err = DXL_LIB_ERROR_WRONG_PACKET;
}
Expand Down

0 comments on commit 3a54c46

Please sign in to comment.