diff --git a/include/bioloid_registers.h b/include/bioloid_registers.h index 3a18e31db477ea33f2527f5f7964e25df0ba6a27..0b3f40486db4df76a169ccd01e2e6b9d3e3ec5f8 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 f58fbcf22696380e21ba63c4b288b13c95ce4e0d..3a2c1d8adda938247ea58ab3a010f8bb79ae0206 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 a1fec04b0cca6c24956c16aca6ad065bd3608600..f69bf9e36faf3403dcb80bf1e036e9aecbc381c5 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;