Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #119

Merged
merged 4 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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