Skip to content
Snippets Groups Projects
Commit 8564d57b authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solved a problem when changing the baudrate. The current solution has to be improved.

parent 178f6beb
No related branches found
No related tags found
No related merge requests found
...@@ -64,8 +64,8 @@ unsigned char CDynamixelServer::compute_checksum(unsigned char *packet,int len) ...@@ -64,8 +64,8 @@ unsigned char CDynamixelServer::compute_checksum(unsigned char *packet,int len)
{ {
for(i=2;i<len;i++) for(i=2;i<len;i++)
checksum+=packet[i]; checksum+=packet[i];
checksum=~checksum;
checksum=checksum%256; checksum=checksum%256;
checksum=~checksum;
} }
} }
...@@ -415,6 +415,7 @@ void CDynamixelServer::set_baudrate(int baudrate) ...@@ -415,6 +415,7 @@ void CDynamixelServer::set_baudrate(int baudrate)
delete[] packet; delete[] packet;
this->dynamixel_access.exit(); this->dynamixel_access.exit();
} }
sleep(1);
/* reconfigure the communciations device */ /* reconfigure the communciations device */
ftdi_config.word_length=8; ftdi_config.word_length=8;
ftdi_config.stop_bits=1; ftdi_config.stop_bits=1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment