mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
added driver for MMA8452QT accelerometer
added mag_declination set option to cli - oops status in cli now prints which ACC hardware is used. work in proress to show difference between hardware with MPU6050 and MPU3050 git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@157 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
b929f79b54
commit
59ccf93dd3
8 changed files with 2746 additions and 2704 deletions
11
src/cli.c
11
src/cli.c
|
@ -16,6 +16,7 @@ static void cliVersion(char *cmdline);
|
|||
|
||||
// from sensors.c
|
||||
extern uint8_t batteryCellCount;
|
||||
extern uint8_t accHardware;
|
||||
|
||||
// from config.c RC Channel mapping
|
||||
extern const char rcChannelLetters[];
|
||||
|
@ -45,6 +46,11 @@ const char *sensorNames[] = {
|
|||
"ACC", "BARO", "MAG", "SONAR", "GPS", NULL
|
||||
};
|
||||
|
||||
//
|
||||
const char *accNames[] = {
|
||||
"ADXL345", "MPU6050", "MMA845x", NULL
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
char *param;
|
||||
|
@ -117,6 +123,7 @@ const clivalue_t valueTable[] = {
|
|||
{ "gimbal_roll_mid", VAR_UINT16, &cfg.gimbal_roll_mid, 100, 3000 },
|
||||
{ "acc_lpf_factor", VAR_UINT8, &cfg.acc_lpf_factor, 0, 250 },
|
||||
{ "gyro_lpf", VAR_UINT16, &cfg.gyro_lpf, 0, 256 },
|
||||
{ "mag_declination", VAR_INT16, &cfg.mag_declination, -18000, 18000 },
|
||||
{ "gps_baudrate", VAR_UINT32, &cfg.gps_baudrate, 1200, 115200 },
|
||||
{ "serial_baudrate", VAR_UINT32, &cfg.serial_baudrate, 1200, 115200 },
|
||||
{ "p_pitch", VAR_UINT8, &cfg.P8[PITCH], 0, 200},
|
||||
|
@ -476,6 +483,10 @@ static void cliStatus(char *cmdline)
|
|||
uartPrint((char *)sensorNames[i]);
|
||||
uartWrite(' ');
|
||||
}
|
||||
if (sensors(SENSOR_ACC)) {
|
||||
uartPrint("ACCHW: ");
|
||||
uartPrint((char *)accNames[accHardware]);
|
||||
}
|
||||
uartPrint("\r\n");
|
||||
|
||||
uartPrint("Cycle Time: ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue