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

Made the dynamixel_base and dynamixel manager libraries compatible with C and...

Made the dynamixel_base and dynamixel manager libraries compatible with C and C++ adding the extern "C" tag.
parent 0a05a09d
No related branches found
No related tags found
No related merge requests found
#ifndef _DYNAMIXEL_H
#define _DYNAMIXEL_H
#ifdef __cplusplus
extern "C" {
#endif
#include "dynamixel_common.h"
#define DYN_HEADER_OFF 0
......@@ -223,4 +227,8 @@ inline unsigned char dyn_get_read_status_id(unsigned char *packet)
return packet[DYN_ID_OFF];
}
#ifdef __cplusplus
}
#endif
#endif
#ifndef _DYNAMIXEL2_H
#define _DYNAMIXEL2_H
#ifdef __cplusplus
extern "C" {
#endif
#include "dynamixel_common.h"
#define DYN2_HEADER_OFF 0
......@@ -246,4 +250,8 @@ inline unsigned char dyn2_get_read_status_id(unsigned char *packet)
return packet[DYN2_ID_OFF];
}
#ifdef __cplusplus
}
#endif
#endif
#ifndef _DYNAMIXEL_MASTER_H
#define _DYNAMIXEL_MASTER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "comm.h"
#include "dynamixel.h"
#include "dynamixel2.h"
......@@ -197,4 +201,8 @@ unsigned char dyn_master_bulk_write(TDynamixelMaster *master,unsigned char num,u
*/
unsigned char dyn_master_relay(TDynamixelMaster *master,unsigned char *inst_pkt,unsigned char *status_pkt);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _DYNAMIXEL_SLAVE_H
#define _DYNAMIXEL_SLAVE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "comm.h"
#include "dynamixel.h"
#include "dynamixel2.h"
......@@ -164,4 +168,8 @@ inline void dyn_slave_stop(TDynamixelSlave *slave)
scheduler_disable_channel(slave->scheduler,slave->sch_channel);
}
#ifdef __cplusplus
}
#endif
#endif
#ifndef _DYNAMIXEL_SLAVE_DEVICE_H
#define _DYNAMIXEL_SLAVE_DEVICE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "dynamixel_slave_registers.h"
#include "dynamixel.h"
#include "dynamixel2.h"
......@@ -203,4 +207,8 @@ inline TMemory *dyn_slave_device_get_memory(TDynamixelSlaveDevice *device)
return &device->memory;
}
#ifdef __cplusplus
}
#endif
#endif
#ifndef _DYN_MANAGER_H
#define _DYN_MANAGER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "dyn_manager_registers.h"
#include "dynamixel_master.h"
#include "memory.h"
......@@ -157,4 +161,8 @@ void dyn_manager_bulk_op_change_length(TDynManager *manager,OP_HANDLE *op,unsign
void dyn_manager_bulk_op_change_data(TDynManager *manager,OP_HANDLE *op,unsigned char num,unsigned char *ids,unsigned char * const data[]);
void dyn_manager_loop(TDynManager *manager);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _DYN_MODULE_H
#define _DYN_MODULE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MODULE_MAX_NUM_MODELS
#error "Please, specify the maximum number of dynamixel master modules with the MODULE_MAX_NUM_MODELS macro"
#endif
......@@ -38,4 +42,8 @@ unsigned char dyn_module_device_is_assigned(TDynModule *module,unsigned char id)
void dyn_module_set_period(TDynModule *module,unsigned char period);
inline unsigned char dyn_module_get_period(TDynModule *module);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _MOTION_MANAGER_H
#define _MOTION_MANAGER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "dyn_module.h"
#ifndef MM_MAX_NUM_MOTION_MODULES
......@@ -64,4 +68,8 @@ unsigned char mmanager_is_servo_enabled(TMotionManager *mmanager,unsigned char s
void mmanager_set_offset(TMotionManager *mmanager,unsigned char servo_id,char offset);
void mmanager_add_module(TMotionManager *mmanager,struct TMotionModule *module);
#ifdef __cplusplus
}
#endif
#endif
#ifndef _MOTION_MODULE_H
#define _MOTION_MODULE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "motion_manager.h"
typedef struct TMotionModule{
......@@ -15,4 +19,8 @@ typedef struct TMotionModule{
void mmodule_init(TMotionModule *module);
#ifdef __cplusplus
}
#endif
#endif
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