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

Corrected the motion manager period register address at initialization.

Changed the conversion function of the compass.
parent fbe9d7f0
No related branches found
No related tags found
No related merge requests found
...@@ -172,7 +172,7 @@ void imu_compass_process_data(void) ...@@ -172,7 +172,7 @@ void imu_compass_process_data(void)
for(i=0;i<3;i++) for(i=0;i<3;i++)
{ {
value=(((int16_t)(i2c_compass_data[i*2]+(i2c_compass_data[i*2+1]<<8)))<<4)/1300; value=(((int16_t)(i2c_compass_data[i*2+1]+(i2c_compass_data[i*2]<<8)))<<4)/1300;
ram_data[BIOLOID_IMU_COMPASS_X_L+i*2]=value&0xFF; ram_data[BIOLOID_IMU_COMPASS_X_L+i*2]=value&0xFF;
ram_data[BIOLOID_IMU_COMPASS_X_H+i*2]=(value>>8); ram_data[BIOLOID_IMU_COMPASS_X_H+i*2]=(value>>8);
} }
......
...@@ -151,9 +151,9 @@ int32_t main(void) ...@@ -151,9 +151,9 @@ int32_t main(void)
// initialize the Analog to digital converter // initialize the Analog to digital converter
// adc_init(); // adc_init();
// initialize motion manager // initialize motion manager
EE_ReadVariable(DEVICE_ID_OFFSET,&eeprom_data); EE_ReadVariable(MM_PERIOD_OFFSET,&eeprom_data);
action_period=eeprom_data&0x00FF; action_period=eeprom_data&0x00FF;
EE_ReadVariable(DEVICE_ID_OFFSET+1,&eeprom_data); EE_ReadVariable(MM_PERIOD_OFFSET+1,&eeprom_data);
action_period+=((eeprom_data&0x00FF)<<8); action_period+=((eeprom_data&0x00FF)<<8);
mm_period=(action_period*1000000)>>16; mm_period=(action_period*1000000)>>16;
manager_init(mm_period); manager_init(mm_period);
......
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