From c2088f00dacef9c00bee3b3f47b2d630c0a0356a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sergi=20Hern=C3=A1ndez?= <shernand@iri.upc.edu>
Date: Sun, 20 Mar 2016 09:35:33 +0000
Subject: [PATCH] Added the walking interface to the dynamixel slave.

---
 include/bioloid_registers.h | 2 ++
 src/bioloid_dyn_slave.c     | 5 ++++-
 src/bioloid_gyro.c          | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/bioloid_registers.h b/include/bioloid_registers.h
index 3a18e31..0b3f404 100644
--- a/include/bioloid_registers.h
+++ b/include/bioloid_registers.h
@@ -354,6 +354,8 @@ typedef enum {
 
 #define      GYRO_BASE_ADDRESS       0x017C
 #define      GYRO_MEM_LENGTH         6
+#define      GYRO_EEPROM_ADDRESS     0x0031
+#define      GYRO_EEPROM_LENGTH      2
 #define      GYRO_CALIBRATE          0x01
 #define      GYRO_EN_CAL_INT         0x02
 #define      GYRO_EN_FALL_DET        0x04
diff --git a/src/bioloid_dyn_slave.c b/src/bioloid_dyn_slave.c
index f58fbcf..3a2c1d8 100644
--- a/src/bioloid_dyn_slave.c
+++ b/src/bioloid_dyn_slave.c
@@ -86,9 +86,12 @@ unsigned char bioloid_on_write(unsigned short int address,unsigned short int len
   // action commands
   if(action_in_range(address,length))
     action_process_write_cmd(address,length,data);
-  // action commands
+  // gyro commands
   if(gyro_in_range(address,length))
     gyro_process_write_cmd(address,length,data);
+  // walk commands
+  if(walking_in_range(address,length))
+    walking_process_write_cmd(address,length,data);
   // write eeprom
   for(i=address,j=0;i<LAST_EEPROM_OFFSET && i<(address+length);i++,j++)
     EE_WriteVariable(i,data[j]);
diff --git a/src/bioloid_gyro.c b/src/bioloid_gyro.c
index a1fec04..f69bf9e 100644
--- a/src/bioloid_gyro.c
+++ b/src/bioloid_gyro.c
@@ -59,7 +59,7 @@ inline void gyro_get_offsets(uint16_t *fb_offset,uint16_t *lr_offset)
 uint8_t gyro_in_range(unsigned short int address, unsigned short int length)
 {
   if(ram_in_window(GYRO_BASE_ADDRESS,GYRO_MEM_LENGTH,address,length) ||
-     ram_in_window(BIOLIOD_GYRO_FB_ADC_CH,BIOLIOD_GYRO_LR_ADC_CH,address,length))
+     ram_in_window(GYRO_EEPROM_ADDRESS,GYRO_EEPROM_LENGTH,address,length))
     return 0x01;
   else
     return 0x00;
-- 
GitLab