Re-label everything to have the correct names. This doesn't actually
change the code at all, so the eeprom and telemetry is all compatible.
Matching changes on the host side will be required to actually process
the data correctly, of course.
Signed-off-by: Keith Packard <keithp@keithp.com>
static void
ao_hmc5883_show(void)
{
static void
ao_hmc5883_show(void)
{
- struct ao_data sample;
- ao_data_get(&sample);
- printf ("X: %d Y: %d Z: %d missed irq: %lu\n",
- sample.hmc5883.x, sample.hmc5883.y, sample.hmc5883.z, ao_hmc5883_missed_irq);
+ printf ("X: %d Z: %d Y: %d missed irq: %lu\n",
+ ao_hmc5883_current.x, ao_hmc5883_current.z, ao_hmc5883_current.y, ao_hmc5883_missed_irq);
}
static const struct ao_cmds ao_hmc5883_cmds[] = {
}
static const struct ao_cmds ao_hmc5883_cmds[] = {
#define HMC5883_ID_C 12
struct ao_hmc5883_sample {
#define HMC5883_ID_C 12
struct ao_hmc5883_sample {
};
extern struct ao_hmc5883_sample ao_hmc5883_current;
};
extern struct ao_hmc5883_sample ao_hmc5883_current;
int16_t gyro_y; /* 20 */
int16_t gyro_z; /* 22 */
int16_t mag_x; /* 24 */
int16_t gyro_y; /* 20 */
int16_t gyro_z; /* 22 */
int16_t mag_x; /* 24 */
- int16_t mag_y; /* 26 */
- int16_t mag_z; /* 28 */
+ int16_t mag_z; /* 26 */
+ int16_t mag_y; /* 28 */
int16_t accel; /* 30 */
} sensor; /* 32 */
/* AO_LOG_TEMP_VOLT */
int16_t accel; /* 30 */
} sensor; /* 32 */
/* AO_LOG_TEMP_VOLT */
#endif
#if HAS_HMC5883
log.u.sensor.mag_x = ao_data_ring[ao_log_data_pos].hmc5883.x;
#endif
#if HAS_HMC5883
log.u.sensor.mag_x = ao_data_ring[ao_log_data_pos].hmc5883.x;
- log.u.sensor.mag_y = ao_data_ring[ao_log_data_pos].hmc5883.y;
log.u.sensor.mag_z = ao_data_ring[ao_log_data_pos].hmc5883.z;
log.u.sensor.mag_z = ao_data_ring[ao_log_data_pos].hmc5883.z;
+ log.u.sensor.mag_y = ao_data_ring[ao_log_data_pos].hmc5883.y;
#endif
log.u.sensor.accel = ao_data_accel(&ao_data_ring[ao_log_data_pos]);
ao_log_mega(&log);
#endif
log.u.sensor.accel = ao_data_accel(&ao_data_ring[ao_log_data_pos]);
ao_log_mega(&log);
#if HAS_HMC5883
telemetry.mega_sensor.mag_x = packet->hmc5883.x;
#if HAS_HMC5883
telemetry.mega_sensor.mag_x = packet->hmc5883.x;
- telemetry.mega_sensor.mag_y = packet->hmc5883.y;
telemetry.mega_sensor.mag_z = packet->hmc5883.z;
telemetry.mega_sensor.mag_z = packet->hmc5883.z;
+ telemetry.mega_sensor.mag_y = packet->hmc5883.y;
#endif
ao_telemetry_send();
#endif
ao_telemetry_send();
int16_t gyro_z; /* 24 */
int16_t mag_x; /* 26 */
int16_t gyro_z; /* 24 */
int16_t mag_x; /* 26 */
- int16_t mag_y; /* 28 */
- int16_t mag_z; /* 30 */
+ int16_t mag_z; /* 28 */
+ int16_t mag_y; /* 30 */