- if ((log_format == AO_LOG_FORMAT_TELEMEGA_OLD || log_format == AO_LOG_FORMAT_TELEMEGA) && nword == 30 && strlen(words[0]) == 1) {
- int i;
- struct ao_ms5607_value value;
-
- type = words[0][0];
- tick = strtoul(words[1], NULL, 16);
-// printf ("%c %04x", type, tick);
- for (i = 2; i < nword; i++) {
- bytes[i - 2] = strtoul(words[i], NULL, 16);
-// printf(" %02x", bytes[i-2]);
- }
-// printf ("\n");
- switch (type) {
- case 'F':
- ao_flight_ground_accel = int16(bytes, 2);
- ao_flight_started = 1;
- ao_ground_pres = int32(bytes, 4);
- ao_ground_height = ao_pa_to_altitude(ao_ground_pres);
- ao_ground_accel_along = int16(bytes, 8);
- ao_ground_accel_across = int16(bytes, 10);
- ao_ground_accel_through = int16(bytes, 12);
- ao_ground_roll = int16(bytes, 14);
- ao_ground_pitch = int16(bytes, 16);
- ao_ground_yaw = int16(bytes, 18);
- ao_ground_mpu6000.accel_x = ao_ground_accel_across;
- ao_ground_mpu6000.accel_y = ao_ground_accel_along;
- ao_ground_mpu6000.accel_z = ao_ground_accel_through;
- ao_ground_mpu6000.gyro_x = ao_ground_pitch >> 9;
- ao_ground_mpu6000.gyro_y = ao_ground_roll >> 9;
- ao_ground_mpu6000.gyro_z = ao_ground_yaw >> 9;
- break;
- case 'A':
- ao_data_static.tick = tick;
- ao_data_static.ms5607_raw.pres = int32(bytes, 0);
- ao_data_static.ms5607_raw.temp = int32(bytes, 4);
- ao_ms5607_convert(&ao_data_static.ms5607_raw, &value);
- ao_data_static.mpu6000.accel_x = int16(bytes, 8);
- ao_data_static.mpu6000.accel_y = int16(bytes, 10);
- ao_data_static.mpu6000.accel_z = int16(bytes, 12);
- ao_data_static.mpu6000.gyro_x = int16(bytes, 14);
- ao_data_static.mpu6000.gyro_y = int16(bytes, 16);
- ao_data_static.mpu6000.gyro_z = int16(bytes, 18);
- ao_data_static.hmc5883.x = int16(bytes, 20);
- ao_data_static.hmc5883.y = int16(bytes, 22);
- ao_data_static.hmc5883.z = int16(bytes, 24);
-#if HAS_MMA655X
- ao_data_static.mma655x = int16(bytes, 26);
- if (ao_config.pad_orientation != AO_PAD_ORIENTATION_ANTENNA_UP)
- ao_data_static.mma655x = ao_data_accel_invert(ao_data_static.mma655x);