summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8c92656)
The mpu9250 on EasyMega v2.0 is rotated 90° compared with EasyMega v1
and TeleMega IMU devices.
Signed-off-by: Keith Packard <keithp@keithp.com>
#define AO_CONFIG_MAX_SIZE 1024
#define LOG_ERASE_MARK 0x55
#define LOG_MAX_ERASE 128
#define AO_CONFIG_MAX_SIZE 1024
#define LOG_ERASE_MARK 0x55
#define LOG_MAX_ERASE 128
-#define AO_LOG_FORMAT AO_LOG_FORMAT_TELEMEGA
+#define AO_LOG_FORMAT AO_LOG_FORMAT_EASYMEGA_2
#define HAS_EEPROM 1
#define USE_INTERNAL_FLASH 0
#define HAS_EEPROM 1
#define USE_INTERNAL_FLASH 0
#define AO_MPU9250_SPI_CS_PIN 13
#define HAS_IMU 1
#define AO_MPU9250_SPI_CS_PIN 13
#define HAS_IMU 1
+#define ao_data_along(packet) ((packet)->mpu9250.accel_x)
+#define ao_data_across(packet) (-(packet)->mpu9250.accel_y)
+#define ao_data_through(packet) ((packet)->mpu9250.accel_z)
+
+#define ao_data_roll(packet) ((packet)->mpu9250.gyro_x)
+#define ao_data_pitch(packet) (-(packet)->mpu9250.gyro_y)
+#define ao_data_yaw(packet) ((packet)->mpu9250.gyro_z)
+
+#define ao_data_mag_along(packet) ((packet)->mpu9250.mag_y)
+#define ao_data_mag_across(packet) (-(packet)->mpu9250.mag_x)
+#define ao_data_mag_through(packet) ((packet)->mpu9250.mag_z)
+
/* ADXL375 */
#define HAS_ADXL375 1
/* ADXL375 */
#define HAS_ADXL375 1
/* X axis is aligned in the other board axis (across) */
/* Z axis is aligned perpendicular to the board (through) */
/* X axis is aligned in the other board axis (across) */
/* Z axis is aligned perpendicular to the board (through) */
#define ao_data_along(packet) ((packet)->mpu9250.accel_y)
#define ao_data_across(packet) ((packet)->mpu9250.accel_x)
#define ao_data_through(packet) ((packet)->mpu9250.accel_z)
#define ao_data_along(packet) ((packet)->mpu9250.accel_y)
#define ao_data_across(packet) ((packet)->mpu9250.accel_x)
#define ao_data_through(packet) ((packet)->mpu9250.accel_z)
#define ao_data_roll(packet) ((packet)->mpu9250.gyro_y)
#define ao_data_pitch(packet) ((packet)->mpu9250.gyro_x)
#define ao_data_yaw(packet) ((packet)->mpu9250.gyro_z)
#define ao_data_roll(packet) ((packet)->mpu9250.gyro_y)
#define ao_data_pitch(packet) ((packet)->mpu9250.gyro_x)
#define ao_data_yaw(packet) ((packet)->mpu9250.gyro_z)
static inline float ao_convert_gyro(float sensor)
{
static inline float ao_convert_gyro(float sensor)
{
* sensors. Also, the Z axis is flipped in sign.
*/
* sensors. Also, the Z axis is flipped in sign.
*/
+#ifndef ao_data_mag_along
#define ao_data_mag_along(packet) ((packet)->mpu9250.mag_x)
#define ao_data_mag_across(packet) ((packet)->mpu9250.mag_y)
#define ao_data_mag_through(packet) ((packet)->mpu9250.mag_z)
#define ao_data_mag_along(packet) ((packet)->mpu9250.mag_x)
#define ao_data_mag_across(packet) ((packet)->mpu9250.mag_y)
#define ao_data_mag_through(packet) ((packet)->mpu9250.mag_z)
#define AO_LOG_FORMAT_TELEFIRETWO 13 /* 32-byte test stand data */
#define AO_LOG_FORMAT_EASYMINI2 14 /* 16-byte MS5607 baro only, 3.3V supply, stm32f042 SoC */
#define AO_LOG_FORMAT_TELEMEGA_3 15 /* 32 byte typed telemega records with 32 bit gyro cal and mpu9250 */
#define AO_LOG_FORMAT_TELEFIRETWO 13 /* 32-byte test stand data */
#define AO_LOG_FORMAT_EASYMINI2 14 /* 16-byte MS5607 baro only, 3.3V supply, stm32f042 SoC */
#define AO_LOG_FORMAT_TELEMEGA_3 15 /* 32 byte typed telemega records with 32 bit gyro cal and mpu9250 */
+#define AO_LOG_FORMAT_EASYMEGA_2 16 /* 32 byte typed telemega records with 32 bit gyro cal, mpu9250 rotated 90° and adxl375 */
#define AO_LOG_FORMAT_NONE 127 /* No log at all */
/* Return the flight number from the given log slot, 0 if none, -slot on failure */
#define AO_LOG_FORMAT_NONE 127 /* No log at all */
/* Return the flight number from the given log slot, 0 if none, -slot on failure */
-#if AO_LOG_FORMAT == AO_LOG_FOMAT_TELEMEGA_OLD || AO_LOG_FORMAT == AO_LOG_FORMAT_TELEMEGA || AO_LOG_FORMAT == AO_LOG_FORMAT_TELEMEGA_3
+#if AO_LOG_FORMAT == AO_LOG_FOMAT_TELEMEGA_OLD || AO_LOG_FORMAT == AO_LOG_FORMAT_TELEMEGA || AO_LOG_FORMAT == AO_LOG_FORMAT_TELEMEGA_3 || AO_LOG_FORMAT == AO_LOG_FORMAT_EASYMEGA_2
typedef struct ao_log_mega ao_log_type;
#endif
typedef struct ao_log_mega ao_log_type;
#endif