Commit bd92378c authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Removed the inline modifiers.

Solved some minor bugs in the Dynamixel 2 interface.
parent 2edb2597
......@@ -498,11 +498,11 @@ comm_error comm_is_receive_done(TComm *dev);
* \brief Function to get the communication error
*
*/
inline unsigned char comm_get_error(TComm *dev);
unsigned char comm_get_error(TComm *dev);
/**
* \brief Function to set the communication error
*
*/
inline void comm_set_error(TComm *dev, unsigned char error);
void comm_set_error(TComm *dev, unsigned char error);
#endif
......@@ -330,12 +330,12 @@ comm_error comm_is_receive_done(TComm *dev)
}
}
inline unsigned char comm_get_error(TComm *dev)
unsigned char comm_get_error(TComm *dev)
{
return dev->error;
}
inline void comm_set_error(TComm *dev, unsigned char error)
void comm_set_error(TComm *dev, unsigned char error)
{
dev->error=error;
}
#ifndef _DYNAMIXEL_COMMON_H
#define _DYNAMIXEL_COMMON_H
#ifndef _DYN_COMMON_H
#define _DYN_COMMON_H
#define MAX_DATA_LENGTH 255
......@@ -17,9 +17,9 @@ typedef struct{
unsigned char *data_addr;
}TWriteData;
typedef enum{no_return=0x00,
return_only_read=0x01,
return_all=0x02} return_level_t;
typedef enum{NO_RETURN=0x00,
RETURN_ONLY_READ=0x01,
RETURN_ALL=0x02} TReturnLevel;
// possible packet types
typedef enum{DYN_PING=0x01,
......
#ifndef _DYNAMIXEL_H
#define _DYNAMIXEL_H
#include "dynamixel_common.h"
#include "dyn_common.h"
#define DYN_HEADER_OFF 0
#define DYN_ID_OFF 2
......@@ -11,9 +11,9 @@
#define DYN_DATA_OFF 5
void dyn_copy_packet(unsigned char *source, unsigned char *destination);
inline unsigned char dyn_get_id(unsigned char *packet);
inline unsigned char dyn_get_length(unsigned char *packet);
inline TDynInstruction dyn_get_instruction(unsigned char *packet);
unsigned char dyn_get_id(unsigned char *packet);
unsigned char dyn_get_length(unsigned char *packet);
TDynInstruction dyn_get_instruction(unsigned char *packet);
unsigned char dyn_check_checksum(unsigned char *packet);
// instruction packet
......@@ -32,17 +32,17 @@ unsigned char dyn_convert_v2_inst_packet(unsigned char *source, unsigned char *d
void dyn_init_ping_packet(unsigned char *packet,unsigned char id);
/* read instruction */
void dyn_init_read_packet(unsigned char *packet,unsigned char id,unsigned char address,unsigned char length);
inline unsigned char dyn_get_read_length(unsigned char *packet);
inline unsigned char dyn_get_read_address(unsigned char *packet);
unsigned char dyn_get_read_length(unsigned char *packet);
unsigned char dyn_get_read_address(unsigned char *packet);
/* write instruction */
void dyn_init_write_packet(unsigned char *packet,unsigned char id,unsigned char address,unsigned char length,unsigned char *data);
inline unsigned char dyn_get_write_address(unsigned char *packet);
inline unsigned char dyn_get_write_length(unsigned char *packet);
inline unsigned char dyn_get_write_data(unsigned char *packet,unsigned char *data);
unsigned char dyn_get_write_address(unsigned char *packet);
unsigned char dyn_get_write_length(unsigned char *packet);
unsigned char dyn_get_write_data(unsigned char *packet,unsigned char *data);
/* registered write instruction */
void dyn_init_reg_write_packet(unsigned char *packet,unsigned char id,unsigned char address,unsigned char length,unsigned char *data);
inline unsigned char dyn_get_reg_write_address(unsigned char *packet);
inline unsigned char dyn_get_reg_write_length(unsigned char *packet);
unsigned char dyn_get_reg_write_address(unsigned char *packet);
unsigned char dyn_get_reg_write_length(unsigned char *packet);
unsigned char dyn_get_reg_write_data(unsigned char *packet,unsigned char *data);
/* action instruction */
void dyn_init_action_packet(unsigned char *packet);
......@@ -69,9 +69,9 @@ typedef struct{
unsigned char dyn_convert_v2_status_packet(unsigned char *source, unsigned char *destination);
void dyn_init_status_packet(unsigned char *packet,unsigned char id,TDynError error,unsigned char length,unsigned char *data);
inline TDynError dyn_get_status_error(unsigned char *packet);
TDynError dyn_get_status_error(unsigned char *packet);
/* read instruction status packet */
unsigned char dyn_get_read_status_data(unsigned char *packet,unsigned char *data);
inline unsigned char dyn_get_read_status_id(unsigned char *packet);
unsigned char dyn_get_read_status_id(unsigned char *packet);
#endif
#ifndef _DYNAMIXEL2_H
#define _DYNAMIXEL2_H
#include "dynamixel_common.h"
#include "dyn_common.h"
#define DYN2_HEADER_OFF 0
#define DYN2_RESERVED 3
......@@ -13,9 +13,9 @@
void dyn2_copy_packet(unsigned char *source, unsigned char *destination);
inline unsigned char dyn2_get_id(unsigned char *packet);
inline unsigned short int dyn2_get_length(unsigned char *packet);
inline TDynInstruction dyn2_get_instruction(unsigned char *packet);
unsigned char dyn2_get_id(unsigned char *packet);
unsigned short int dyn2_get_length(unsigned char *packet);
TDynInstruction dyn2_get_instruction(unsigned char *packet);
unsigned char dyn2_check_checksum(unsigned char *packet);
// instruction packet
......@@ -34,17 +34,17 @@ unsigned char dyn2_convert_v1_inst_packet(unsigned char *source, unsigned char *
void dyn2_init_ping_packet(unsigned char *packet,unsigned char id);
/* read instruction */
void dyn2_init_read_packet(unsigned char *packet,unsigned char id,unsigned short int address,unsigned short int length);
inline unsigned short int dyn2_get_read_length(unsigned char *packet);
inline unsigned short int dyn2_get_read_address(unsigned char *packet);
unsigned short int dyn2_get_read_length(unsigned char *packet);
unsigned short int dyn2_get_read_address(unsigned char *packet);
/* write instruction */
void dyn2_init_write_packet(unsigned char *packet,unsigned char id,unsigned short int address,unsigned short int length,unsigned char *data);
inline unsigned short int dyn2_get_write_address(unsigned char *packet);
inline unsigned short int dyn2_get_write_length(unsigned char *packet);
inline unsigned short int dyn2_get_write_data(unsigned char *packet,unsigned char *data);
unsigned short int dyn2_get_write_address(unsigned char *packet);
unsigned short int dyn2_get_write_length(unsigned char *packet);
unsigned short int dyn2_get_write_data(unsigned char *packet,unsigned char *data);
/* 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);
inline unsigned short int dyn2_get_reg_write_address(unsigned char *packet);
inline unsigned short int dyn2_get_reg_write_length(unsigned char *packet);
unsigned short int dyn2_get_reg_write_address(unsigned char *packet);
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);
/* action instruction */
void dyn2_init_action_packet(unsigned char *packet);
......@@ -77,9 +77,9 @@ typedef struct{
unsigned char dyn2_convert_v1_status_packet(TDynInstruction inst,unsigned char *source, unsigned char *destination);
void dyn2_init_status_packet(unsigned char *packet,unsigned char id,TDynError error,unsigned short int length,unsigned char *data);
inline TDynError dyn2_get_status_error(unsigned char *packet);
TDynError dyn2_get_status_error(unsigned char *packet);
/* read instruction status packet */
unsigned short int dyn2_get_read_status_data(unsigned char *packet,unsigned char *data);
inline unsigned char dyn2_get_read_status_id(unsigned char *packet);
unsigned char dyn2_get_read_status_id(unsigned char *packet);
#endif
......@@ -21,7 +21,7 @@ typedef struct
unsigned short int op_length;
unsigned char tx_buffer[MAX_DYN_MASTER_TX_BUFFER_LEN];
unsigned char rx_buffer[MAX_DYN_MASTER_RX_BUFFER_LEN];
return_level_t return_level;
TReturnLevel return_level;
unsigned char packet_ready;
unsigned char received_bytes;
void (*set_tx_mode)(void);
......@@ -34,8 +34,8 @@ typedef struct
/* public functions */
void dyn_master_init(TDynamixelMaster *master,TComm *dev,TDynVersion version);
void dyn_master_set_rx_timeout(TDynamixelMaster *master,unsigned short int timeout_ms);
inline void dyn_master_set_return_level(TDynamixelMaster *master,return_level_t level);
inline return_level_t dyn_master_get_return_level(TDynamixelMaster *master);
void dyn_master_set_return_level(TDynamixelMaster *master,TReturnLevel level);
TReturnLevel dyn_master_get_return_level(TDynamixelMaster *master);
void dyn_master_scan(TDynamixelMaster *master,unsigned char *num,unsigned char *ids);
unsigned char dyn_master_ping(TDynamixelMaster *master,unsigned char id);
unsigned char dyn_master_read_byte(TDynamixelMaster *master,unsigned char id,unsigned short int address,unsigned char *data);
......
......@@ -23,7 +23,7 @@ typedef struct
TDynVersion version;
unsigned char address;
unsigned char return_delay;
return_level_t return_level;
TReturnLevel return_level;
unsigned char packet_ready;
unsigned char received_bytes;
unsigned short int rx_timeout_ms;
......@@ -50,13 +50,13 @@ typedef struct
/* public functions */
void dyn_slave_init(TDynamixelSlave *slave,TComm *dev,unsigned char address,TDynVersion version);
void dyn_slave_set_rx_timeout(TDynamixelSlave *slave,unsigned short int timeout_ms);
inline void dyn_slave_set_address(TDynamixelSlave *slave,unsigned char address);
inline unsigned char dyn_slave_get_address(TDynamixelSlave *slave);
inline void dyn_slave_set_return_delay(TDynamixelSlave *slave,unsigned char delay);
inline unsigned char dyn_slave_get_return_delay(TDynamixelSlave *slave);
inline void dyn_slave_set_return_level(TDynamixelSlave *slave,return_level_t level);
inline return_level_t dyn_slave_get_return_level(TDynamixelSlave *slave);
inline TDynVersion dyn_slave_get_version(TDynamixelSlave *slave);
void dyn_slave_set_address(TDynamixelSlave *slave,unsigned char address);
unsigned char dyn_slave_get_address(TDynamixelSlave *slave);
void dyn_slave_set_return_delay(TDynamixelSlave *slave,unsigned char delay);
unsigned char dyn_slave_get_return_delay(TDynamixelSlave *slave);
void dyn_slave_set_return_level(TDynamixelSlave *slave,TReturnLevel level);
TReturnLevel dyn_slave_get_return_level(TDynamixelSlave *slave);
TDynVersion dyn_slave_get_version(TDynamixelSlave *slave);
void dyn_slave_loop(TDynamixelSlave *slave);
......
......@@ -40,17 +40,17 @@ void dyn_copy_packet(unsigned char *source, unsigned char *destination)
destination[i]=source[i];
}
inline unsigned char dyn_get_id(unsigned char *packet)
unsigned char dyn_get_id(unsigned char *packet)
{
return packet[DYN_ID_OFF];
}
inline unsigned char dyn_get_length(unsigned char *packet)
unsigned char dyn_get_length(unsigned char *packet)
{
return packet[DYN_LENGTH_OFF];
}
inline TDynInstruction dyn_get_instruction(unsigned char *packet)
TDynInstruction dyn_get_instruction(unsigned char *packet)
{
return packet[DYN_INST_OFF];
}
......@@ -99,12 +99,12 @@ void dyn_init_read_packet(unsigned char *packet,unsigned char id,unsigned char a
dyn_set_checksum(packet);
}
inline unsigned char dyn_get_read_length(unsigned char *packet)
unsigned char dyn_get_read_length(unsigned char *packet)
{
return packet[DYN_DATA_OFF+1];
}
inline unsigned char dyn_get_read_address(unsigned char *packet)
unsigned char dyn_get_read_address(unsigned char *packet)
{
return packet[DYN_DATA_OFF];
}
......@@ -125,12 +125,12 @@ void dyn_init_write_packet(unsigned char *packet,unsigned char id,unsigned char
dyn_set_checksum(packet);
}
inline unsigned char dyn_get_write_address(unsigned char *packet)
unsigned char dyn_get_write_address(unsigned char *packet)
{
return packet[DYN_DATA_OFF];
}
inline unsigned char dyn_get_write_length(unsigned char *packet)
unsigned char dyn_get_write_length(unsigned char *packet)
{
return packet[DYN_LENGTH_OFF]-3;
}
......@@ -161,12 +161,12 @@ void dyn_init_reg_write_packet(unsigned char *packet,unsigned char id,unsigned c
dyn_set_checksum(packet);
}
inline unsigned char dyn_get_reg_write_address(unsigned char *packet)
unsigned char dyn_get_reg_write_address(unsigned char *packet)
{
return packet[DYN_DATA_OFF];
}
inline unsigned char dyn_get_reg_write_length(unsigned char *packet)
unsigned char dyn_get_reg_write_length(unsigned char *packet)
{
return packet[DYN_LENGTH_OFF]-3;
}
......@@ -315,7 +315,7 @@ void dyn_init_status_packet(unsigned char *packet,unsigned char id,TDynError err
dyn_set_checksum(packet);
}
inline TDynError dyn_get_status_error(unsigned char *packet)
TDynError dyn_get_status_error(unsigned char *packet)
{
return packet[DYN_ERROR_OFF];
}
......@@ -331,7 +331,7 @@ unsigned char dyn_get_read_status_data(unsigned char *packet,unsigned char *data
return packet[DYN_LENGTH_OFF]-0x02;
}
inline unsigned char dyn_get_read_status_id(unsigned char *packet)
unsigned char dyn_get_read_status_id(unsigned char *packet)
{
return packet[DYN_ID_OFF];
}
......
......@@ -79,17 +79,17 @@ void dyn2_copy_packet(unsigned char *source, unsigned char *destination)
destination[i]=source[i];
}
inline unsigned char dyn2_get_id(unsigned char *packet)
unsigned char dyn2_get_id(unsigned char *packet)
{
return packet[DYN2_ID_OFF];
}
inline unsigned short int dyn2_get_length(unsigned char *packet)
unsigned short int dyn2_get_length(unsigned char *packet)
{
return (packet[DYN2_LENGTH_OFF]+packet[DYN2_LENGTH_OFF+1]*256);
}
inline TDynInstruction dyn2_get_instruction(unsigned char *packet)
TDynInstruction dyn2_get_instruction(unsigned char *packet)
{
return packet[DYN2_INST_OFF];
}
......@@ -145,12 +145,12 @@ void dyn2_init_read_packet(unsigned char *packet,unsigned char id,unsigned short
dyn2_set_checksum(packet);
}
inline unsigned short int dyn2_get_read_length(unsigned char *packet)
unsigned short int dyn2_get_read_length(unsigned char *packet)
{
return (packet[DYN2_DATA_OFF+2]+packet[DYN2_DATA_OFF+3]*256);
}
inline unsigned short int dyn2_get_read_address(unsigned char *packet)
unsigned short int dyn2_get_read_address(unsigned char *packet)
{
return (packet[DYN2_DATA_OFF]+packet[DYN2_DATA_OFF+1]*256);
}
......@@ -175,12 +175,12 @@ void dyn2_init_write_packet(unsigned char *packet,unsigned char id,unsigned shor
dyn2_set_checksum(packet);
}
inline unsigned short int dyn2_get_write_address(unsigned char *packet)
unsigned short int dyn2_get_write_address(unsigned char *packet)
{
return (packet[DYN2_DATA_OFF]+packet[DYN2_DATA_OFF+1]*256);
}
inline unsigned short int dyn2_get_write_length(unsigned char *packet)
unsigned short int dyn2_get_write_length(unsigned char *packet)
{
return (packet[DYN2_LENGTH_OFF]+packet[DYN2_LENGTH_OFF+1]*256)-5;
}
......@@ -216,12 +216,12 @@ void dyn2_init_reg_write_packet(unsigned char *packet,unsigned char id,unsigned
dyn2_set_checksum(packet);
}
inline unsigned short int dyn2_get_reg_write_address(unsigned char *packet)
unsigned short int dyn2_get_reg_write_address(unsigned char *packet)
{
return (packet[DYN2_DATA_OFF]+packet[DYN2_DATA_OFF+1]*256);
}
inline unsigned short int dyn2_get_reg_write_length(unsigned char *packet)
unsigned short int dyn2_get_reg_write_length(unsigned char *packet)
{
return (packet[DYN2_LENGTH_OFF]+packet[DYN2_LENGTH_OFF+1]*256)-5;
}
......@@ -348,7 +348,7 @@ unsigned char dyn2_sync_read_id_present(unsigned char *packet,unsigned char id,u
if(i==0)
return 0x00;
else
return packet[DYN2_DATA_OFF+3+i];
return packet[DYN2_DATA_OFF+4+i];
}
return 0xFF;
}
......@@ -491,7 +491,7 @@ void dyn2_init_status_packet(unsigned char *packet,unsigned char id,TDynError er
dyn2_set_checksum(packet);
}
inline TDynError dyn2_get_status_error(unsigned char *packet)
TDynError dyn2_get_status_error(unsigned char *packet)
{
return packet[DYN2_DATA_OFF];
}
......@@ -508,7 +508,7 @@ unsigned short int dyn2_get_read_status_data(unsigned char *packet,unsigned char
return length;
}
inline unsigned char dyn2_get_read_status_id(unsigned char *packet)
unsigned char dyn2_get_read_status_id(unsigned char *packet)
{
return packet[DYN2_ID_OFF];
}
......@@ -251,7 +251,7 @@ unsigned char dyn_master_start_read_table(TDynamixelMaster *master,unsigned char
else
dyn2_init_read_packet(master->tx_buffer,id,address,length);
master->rx_num_packets=0x01;
if(master->return_level==no_return || id==DYN_BROADCAST_ID)
if(master->return_level==NO_RETURN || id==DYN_BROADCAST_ID)
master->rx_no_answer=0x01;
else
master->rx_no_answer=0x00;
......@@ -271,7 +271,7 @@ unsigned char dyn_master_is_read_table_done(TDynamixelMaster *master,unsigned ch
if((error=dyn_master_is_transmission_done(master))==DYN_SUCCESS)
{
// wait for the replay within the given timeout
if(master->return_level!=no_return && id!=DYN_BROADCAST_ID)
if(master->return_level!=NO_RETURN && id!=DYN_BROADCAST_ID)
{
if((error=dyn_master_is_reception_done(master))==DYN_SUCCESS)
{
......@@ -331,7 +331,7 @@ unsigned char dyn_master_start_write_table(TDynamixelMaster *master,unsigned cha
else
dyn2_init_write_packet(master->tx_buffer,id,address,length,data);
master->rx_num_packets=0x01;
if(master->return_level==return_all && id!=DYN_BROADCAST_ID)
if(master->return_level==RETURN_ALL && id!=DYN_BROADCAST_ID)
master->rx_no_answer=0x00;
else
master->rx_no_answer=0x01;
......@@ -351,7 +351,7 @@ unsigned char dyn_master_is_write_table_done(TDynamixelMaster *master,unsigned c
if((error=dyn_master_is_transmission_done(master))==DYN_SUCCESS)
{
// wait for the replay within the given timeout
if(master->return_level==return_all && id!=DYN_BROADCAST_ID)
if(master->return_level==RETURN_ALL && id!=DYN_BROADCAST_ID)
{
if((error=dyn_master_is_reception_done(master))==DYN_SUCCESS)
{
......@@ -426,7 +426,7 @@ unsigned char dyn_master_start_sync_read(TDynamixelMaster *master,unsigned char
{
dyn2_init_sync_read_packet(master->tx_buffer,num,ids,address,length);
master->rx_num_packets=num;
if(master->return_level==no_return)
if(master->return_level==NO_RETURN)
master->rx_no_answer=0x01;
else
master->rx_no_answer=0x00;
......@@ -453,7 +453,7 @@ unsigned char dyn_master_is_sync_read_done(TDynamixelMaster *master,unsigned cha
if((error=dyn_master_is_transmission_done(master))==DYN_SUCCESS)
{
// wait for the replay within the given timeout
if(master->return_level!=no_return)
if(master->return_level!=NO_RETURN)
{
if(num_dev_done<num)
{
......@@ -554,7 +554,7 @@ unsigned char dyn_master_start_bulk_read(TDynamixelMaster *master,unsigned char
else
dyn2_init_bulk_read_packet(master->tx_buffer,num,ids,address,length);
master->rx_num_packets=num;
if(master->return_level==no_return)
if(master->return_level==NO_RETURN)
master->rx_no_answer=0x01;
else
master->rx_no_answer=0x00;
......@@ -575,7 +575,7 @@ unsigned char dyn_master_is_bulk_read_done(TDynamixelMaster *master,unsigned cha
if((error=dyn_master_is_transmission_done(master))==DYN_SUCCESS)
{
// wait for the replay within the given timeout
if(master->return_level!=no_return)
if(master->return_level!=NO_RETURN)
{
if(num_dev_done<num)
{
......@@ -657,7 +657,7 @@ void dyn_master_init(TDynamixelMaster *master,TComm *dev,TDynVersion version)
master->rx_timeout_ms=50;
master->rx_no_answer=0x00;
master->rx_num_packets=0x00;
master->return_level=return_all;
master->return_level=RETURN_ALL;
master->set_rx_mode();
}
......@@ -667,12 +667,12 @@ void dyn_master_set_rx_timeout(TDynamixelMaster *master,unsigned short int timeo
master->rx_timeout_ms=timeout_ms;
}
inline void dyn_master_set_return_level(TDynamixelMaster *master,return_level_t level)
void dyn_master_set_return_level(TDynamixelMaster *master,TReturnLevel level)
{
master->return_level=level;
}
inline return_level_t dyn_master_get_return_level(TDynamixelMaster *master)
TReturnLevel dyn_master_get_return_level(TDynamixelMaster *master)
{
return master->return_level;
}
......@@ -750,7 +750,7 @@ unsigned char dyn_master_read_table(TDynamixelMaster *master,unsigned char id,un
else
dyn2_init_read_packet(master->tx_buffer,id,address,length);
master->rx_num_packets=0x01;
if(master->return_level==no_return || id==DYN_BROADCAST_ID)
if(master->return_level==NO_RETURN || id==DYN_BROADCAST_ID)
master->rx_no_answer=0x01;
else
master->rx_no_answer=0x00;
......@@ -769,7 +769,7 @@ unsigned char dyn_master_read_table(TDynamixelMaster *master,unsigned char id,un
return error;
}
// wait for the replay within the given timeout
if(master->return_level!=no_return && id!=DYN_BROADCAST_ID)
if(master->return_level!=NO_RETURN && id!=DYN_BROADCAST_ID)
{
if((error=dyn_master_wait_reception(master))==DYN_SUCCESS)
{
......@@ -813,7 +813,7 @@ unsigned char dyn_master_write_table(TDynamixelMaster *master,unsigned char id,
else
dyn2_init_write_packet(master->tx_buffer,id,address,length,data);
master->rx_num_packets=0x01;
if(master->return_level==return_all && id!=DYN_BROADCAST_ID)
if(master->return_level==RETURN_ALL && id!=DYN_BROADCAST_ID)
master->rx_no_answer=0x00;
else
master->rx_no_answer=0x01;
......@@ -832,7 +832,7 @@ unsigned char dyn_master_write_table(TDynamixelMaster *master,unsigned char id,
return error;
}
// wait for the replay within the given timeout
if(master->return_level==return_all && id!=DYN_BROADCAST_ID)
if(master->return_level==RETURN_ALL && id!=DYN_BROADCAST_ID)
error=dyn_master_wait_reception(master);
return error;
......@@ -848,7 +848,7 @@ unsigned char dyn_master_reg_write(TDynamixelMaster *master,unsigned char id, un
else
dyn2_init_reg_write_packet(master->tx_buffer,id,address,length,data);
master->rx_num_packets=0x01;
if(master->return_level==return_all && id!=DYN_BROADCAST_ID)
if(master->return_level==RETURN_ALL && id!=DYN_BROADCAST_ID)
master->rx_no_answer=0x00;
else
master->rx_no_answer=0x01;
......@@ -867,7 +867,7 @@ unsigned char dyn_master_reg_write(TDynamixelMaster *master,unsigned char id, un
return error;
}
// wait for the replay within the given timeout
if(master->return_level==return_all && id!=DYN_BROADCAST_ID)
if(master->return_level==RETURN_ALL && id!=DYN_BROADCAST_ID)
error=dyn_master_wait_reception(master);
return error;
......@@ -940,7 +940,7 @@ unsigned char dyn_master_sync_read(TDynamixelMaster *master,unsigned char num,un
{
dyn2_init_sync_read_packet(master->tx_buffer,num,ids,address,length);
master->rx_num_packets=num;
if(master->return_level==no_return)
if(master->return_level==NO_RETURN)
master->rx_no_answer=0x01;
else
master->rx_no_answer=0x00;
......@@ -959,7 +959,7 @@ unsigned char dyn_master_sync_read(TDynamixelMaster *master,unsigned char num,un
return error;
}
// wait for the replay within the given timeout
if(master->return_level!=no_return)
if(master->return_level!=NO_RETURN)
{
for(i=0;i<num;i++)
{
......@@ -993,7 +993,7 @@ unsigned char dyn_master_bulk_read(TDynamixelMaster *master,unsigned char num,un
else
dyn2_init_bulk_read_packet(master->tx_buffer,num,ids,address,length);
master->rx_num_packets=num;
if(master->return_level==no_return)
if(master->return_level==NO_RETURN)
master->rx_no_answer=0x01;
else
master->rx_no_answer=0x00;
......@@ -1012,7 +1012,7 @@ unsigned char dyn_master_bulk_read(TDynamixelMaster *master,unsigned char num,un
return error;
}
// wait for the replay within the given timeout
if(master->return_level!=no_return)
if(master->return_level!=NO_RETURN)
{
for(i=0;i<num;i++)
{
......
......@@ -176,7 +176,7 @@ void dyn_v1_slave_loop(TDynamixelSlave *slave)
dyn_slave_send_status_packet(slave,DYN_NO_ERROR,0,data);
break;
case DYN_READ: error=slave->on_read(dyn_get_read_address(slave->rx_buffer),dyn_get_read_length(slave->rx_buffer),data);
if(slave->return_level!=no_return && id!=DYN_BROADCAST_ID)
if(slave->return_level!=NO_RETURN && id!=DYN_BROADCAST_ID)
{
if(error==DYN_NO_ERROR)
dyn_slave_send_status_packet(slave,DYN_NO_ERROR,dyn_get_read_length(slave->rx_buffer),data);
......@@ -186,7 +186,7 @@ void dyn_v1_slave_loop(TDynamixelSlave *slave)
break;
case DYN_WRITE: length=dyn_get_write_data(slave->rx_buffer,data);
error=slave->on_write(dyn_get_write_address(slave->rx_buffer),length,data);
if(slave->return_level==return_all && id!=DYN_BROADCAST_ID)
if(slave->return_level==RETURN_ALL && id!=DYN_BROADCAST_ID)
{
if(error==DYN_NO_ERROR)
dyn_slave_send_status_packet(slave,DYN_NO_ERROR,0,data);
......@@ -196,7 +196,7 @@ void dyn_v1_slave_loop(TDynamixelSlave *slave)
break;
case DYN_REG_WRITE: slave->reg_length=dyn_get_reg_write_data(slave->rx_buffer,slave->reg_buffer);
slave->reg_address=dyn_get_reg_write_address(slave->rx_buffer);
if(slave->return_level==return_all && id!=DYN_BROADCAST_ID)
if(slave->return_level==RETURN_ALL && id!=DYN_BROADCAST_ID)
dyn_slave_send_status_packet(slave,DYN_NO_ERROR,0,data);
break;
case DYN_ACTION: if(slave->reg_address!=0xFFFF)
......@@ -205,7 +205,7 @@ void dyn_v1_slave_loop(TDynamixelSlave *slave)
slave->reg_address=0xFFFF;
}
else
if(slave->return_level==return_all && id!=DYN_BROADCAST_ID)
if(slave->return_level==RETURN_ALL && id!=DYN_BROADCAST_ID)
dyn_slave_send_status_packet(slave,DYN_INST_ERROR,0,data);