From 38d416cf924f372b760d377ec3a7e1300936194c Mon Sep 17 00:00:00 2001 From: David Carlson Date: Mon, 23 May 2011 20:53:15 -0700 Subject: [PATCH] Fix Y/Z axis mixup in self-test procedure (currently not used) --- flight/PiOS/Common/pios_hmc5883.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flight/PiOS/Common/pios_hmc5883.c b/flight/PiOS/Common/pios_hmc5883.c index b859c4bf1..1e5849cce 100644 --- a/flight/PiOS/Common/pios_hmc5883.c +++ b/flight/PiOS/Common/pios_hmc5883.c @@ -357,8 +357,8 @@ int32_t PIOS_HMC5883_Test(void) uint8_t values[6]; while (!PIOS_HMC5883_Read(PIOS_HMC5883_DATAOUT_XMSB_REG, values, 6)) ; int16_t x = (int16_t) (((uint16_t) values[0] << 8) + values[1]); - int16_t y = (int16_t) (((uint16_t) values[2] << 8) + values[3]); - int16_t z = (int16_t) (((uint16_t) values[4] << 8) + values[5]); + int16_t z = (int16_t) (((uint16_t) values[2] << 8) + values[3]); + int16_t y = (int16_t) (((uint16_t) values[4] << 8) + values[5]); if(abs(abs(x) - 766) > 20) passed &= 0;