Added compass calibration variables to EEPROM and CLI
This commit is contained in:
parent
12278e3866
commit
702853d67c
@ -201,6 +201,10 @@ typedef enum {
|
|||||||
EEPROM_FLAG_ACCELTUNE_FINE_ROLL,
|
EEPROM_FLAG_ACCELTUNE_FINE_ROLL,
|
||||||
EEPROM_FLAG_ACCELTUNE_FINE_PITCH,
|
EEPROM_FLAG_ACCELTUNE_FINE_PITCH,
|
||||||
|
|
||||||
|
/* Compass calibration */
|
||||||
|
EEPROM_FLAG_COMPASSTUNE_MAGNET_MAX,
|
||||||
|
EEPROM_FLAG_COMPASSTUNE_MAGNET_MIN,
|
||||||
|
|
||||||
/* Counts the amount of system settings */
|
/* Counts the amount of system settings */
|
||||||
EEPROM_SYS_COUNT
|
EEPROM_SYS_COUNT
|
||||||
} EEPROM_SYS_ID_t;
|
} EEPROM_SYS_ID_t;
|
||||||
|
@ -9,6 +9,7 @@ void calibrate_compass();
|
|||||||
|
|
||||||
void calculate_heading();
|
void calculate_heading();
|
||||||
|
|
||||||
|
extern int MagnetMax[3];
|
||||||
|
extern int MagnetMin[3];
|
||||||
|
|
||||||
#endif //DRIVERS_COMPASS_H
|
#endif //DRIVERS_COMPASS_H
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "drivers/motors.h"
|
#include "drivers/motors.h"
|
||||||
#include "drivers/accel_gyro.h"
|
#include "drivers/accel_gyro.h"
|
||||||
#include "Flight/pid.h"
|
#include "Flight/pid.h"
|
||||||
|
#include "drivers/compass.h"
|
||||||
|
|
||||||
#define cliActivateCharacter 35
|
#define cliActivateCharacter 35
|
||||||
#define commandValueError 0xFFFFFFFFFFFFFFFF
|
#define commandValueError 0xFFFFFFFFFFFFFFFF
|
||||||
@ -1554,7 +1555,7 @@ void cliRun()
|
|||||||
if (ReceiveBinaryDecision(121,110))
|
if (ReceiveBinaryDecision(121,110))
|
||||||
{
|
{
|
||||||
TransmitBack("Starting calibration! \n\n\r");
|
TransmitBack("Starting calibration! \n\n\r");
|
||||||
TransmitBack("NOT IMPLEMENTED! \n\n\r");
|
calibrate_compass();
|
||||||
TransmitBack("Calibration complete! \n\n\r");
|
TransmitBack("Calibration complete! \n\n\r");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "drivers/motormix.h"
|
#include "drivers/motormix.h"
|
||||||
#include "drivers/motors.h"
|
#include "drivers/motors.h"
|
||||||
#include "Flight/pid.h"
|
#include "Flight/pid.h"
|
||||||
|
#include "drivers/compass.h"
|
||||||
|
|
||||||
/* Reads the EEPROM version from EEPROM - Is compared to EEPROM_SYS_VERSION */
|
/* Reads the EEPROM version from EEPROM - Is compared to EEPROM_SYS_VERSION */
|
||||||
uint8_t stored_eeprom_identifier;
|
uint8_t stored_eeprom_identifier;
|
||||||
@ -282,6 +283,19 @@ EEPROM_DATA_t eeprom_sys_Arr[EEPROM_SYS_COUNT] = {
|
|||||||
.size = sizeof(float),
|
.size = sizeof(float),
|
||||||
.dataPtr = &(accPitchFineTune),
|
.dataPtr = &(accPitchFineTune),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/* Compass calibration */
|
||||||
|
[EEPROM_FLAG_COMPASSTUNE_MAGNET_MAX] =
|
||||||
|
{
|
||||||
|
.size = sizeof(MagnetMax),
|
||||||
|
.dataPtr = &(MagnetMax),
|
||||||
|
},
|
||||||
|
[EEPROM_FLAG_COMPASSTUNE_MAGNET_MIN] =
|
||||||
|
{
|
||||||
|
.size = sizeof(MagnetMin),
|
||||||
|
.dataPtr = &(MagnetMin),
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Data pointers and sizes for profile content */
|
/* Data pointers and sizes for profile content */
|
||||||
|
Reference in New Issue
Block a user