diff --git a/sw/airborne/arch/stm32/subsystems/imu/imu_b2_arch.c b/sw/airborne/arch/stm32/subsystems/imu/imu_b2_arch.c index 0f229c3de7..acad03c9a3 100644 --- a/sw/airborne/arch/stm32/subsystems/imu/imu_b2_arch.c +++ b/sw/airborne/arch/stm32/subsystems/imu/imu_b2_arch.c @@ -81,7 +81,7 @@ void imu_periodic(void) { SPI_Cmd(SPI2, ENABLE); max1168_read(); #if IMU_B2_MAG_TYPE == IMU_B2_MAG_HMC5843 - hmc5843_periodic(); + hmc5843_periodic(); #endif } diff --git a/sw/airborne/boards/lisa_l/baro_board.h b/sw/airborne/boards/lisa_l/baro_board.h index f6c59fd3c7..4eec5cfdee 100644 --- a/sw/airborne/boards/lisa_l/baro_board.h +++ b/sw/airborne/boards/lisa_l/baro_board.h @@ -36,24 +36,24 @@ extern void baro_board_send_config_abs(void); extern void baro_board_send_config_diff(void); #define BaroEvent(_b_abs_handler, _b_diff_handler) { \ - if (baro_board.status == LBS_READING_ABS && \ - baro_trans.status != I2CTransPending) { \ - baro_board.status = LBS_READ_ABS; \ - if (baro_trans.status == I2CTransSuccess) { \ - int16_t tmp = baro_trans.buf[0]<<8 | baro_trans.buf[1]; \ - baro.absolute = tmp; \ - _b_abs_handler(); \ - } \ - } \ + if (baro_board.status == LBS_READING_ABS && \ + baro_trans.status != I2CTransPending) { \ + baro_board.status = LBS_READ_ABS; \ + if (baro_trans.status == I2CTransSuccess) { \ + int16_t tmp = baro_trans.buf[0]<<8 | baro_trans.buf[1]; \ + baro.absolute = tmp; \ + _b_abs_handler(); \ + } \ + } \ else if (baro_board.status == LBS_READING_DIFF && \ - baro_trans.status != I2CTransPending) { \ - baro_board.status = LBS_READ_DIFF; \ - if (baro_trans.status == I2CTransSuccess) { \ - int16_t tmp = baro_trans.buf[0]<<8 | baro_trans.buf[1]; \ - baro.differential = tmp; \ - _b_diff_handler(); \ - } \ - } \ + baro_trans.status != I2CTransPending) { \ + baro_board.status = LBS_READ_DIFF; \ + if (baro_trans.status == I2CTransSuccess) { \ + int16_t tmp = baro_trans.buf[0]<<8 | baro_trans.buf[1]; \ + baro.differential = tmp; \ + _b_diff_handler(); \ + } \ + } \ } diff --git a/sw/airborne/peripherals/hmc5843.c b/sw/airborne/peripherals/hmc5843.c index 188b3d18b0..4eac86d75a 100644 --- a/sw/airborne/peripherals/hmc5843.c +++ b/sw/airborne/peripherals/hmc5843.c @@ -19,7 +19,7 @@ void hmc5843_init(void) hmc5843.i2c_trans.slave_addr = HMC5843_ADDR; #ifndef HMC5843_NO_IRQ - hmc5843_arch_init(); + hmc5843_arch_init(); #endif } @@ -31,21 +31,21 @@ static void send_config(void) hmc5843.i2c_trans.buf[1] = 0x00 | (0x06 << 2); hmc5843.i2c_trans.len_w = 2; i2c_submit(&HMC5843_I2C_DEVICE,&hmc5843.i2c_trans); - while(hmc5843.i2c_trans.status == I2CTransPending); + while(hmc5843.i2c_trans.status == I2CTransPending); hmc5843.i2c_trans.type = I2CTransTx; hmc5843.i2c_trans.buf[0] = HMC5843_REG_CFGB; // set to gain to 1 Gauss hmc5843.i2c_trans.buf[1] = 0x01<<5; hmc5843.i2c_trans.len_w = 2; i2c_submit(&HMC5843_I2C_DEVICE,&hmc5843.i2c_trans); - while(hmc5843.i2c_trans.status == I2CTransPending); + while(hmc5843.i2c_trans.status == I2CTransPending); hmc5843.i2c_trans.type = I2CTransTx; hmc5843.i2c_trans.buf[0] = HMC5843_REG_MODE; // set to continuous mode hmc5843.i2c_trans.buf[1] = 0x00; hmc5843.i2c_trans.len_w = 2; i2c_submit(&HMC5843_I2C_DEVICE,&hmc5843.i2c_trans); - while(hmc5843.i2c_trans.status == I2CTransPending); + while(hmc5843.i2c_trans.status == I2CTransPending); } @@ -123,8 +123,8 @@ void hmc5843_periodic(void) } #ifdef HMC5843_NO_IRQ - // < 50Hz - fake_mag_eoc = 1; + // < 50Hz + fake_mag_eoc = 1; #endif } diff --git a/sw/airborne/peripherals/hmc5843.h b/sw/airborne/peripherals/hmc5843.h index a198ddab11..ab71e07d80 100644 --- a/sw/airborne/peripherals/hmc5843.h +++ b/sw/airborne/peripherals/hmc5843.h @@ -73,11 +73,11 @@ extern void hmc5843_idle_task(void); #include -#define MagEvent(_m_handler) { \ - hmc5843_idle_task(); \ - if (hmc5843.data_available) { \ - _m_handler(); \ - } \ +#define MagEvent(_m_handler) { \ + hmc5843_idle_task(); \ + if (hmc5843.data_available) { \ + _m_handler(); \ + } \ } #endif /* HMC5843_H */ diff --git a/sw/airborne/subsystems/imu/imu_b2.h b/sw/airborne/subsystems/imu/imu_b2.h index 91f7b34759..2c076d03ad 100644 --- a/sw/airborne/subsystems/imu/imu_b2.h +++ b/sw/airborne/subsystems/imu/imu_b2.h @@ -170,7 +170,7 @@ #include "peripherals/hmc5843.h" #define foo_handler() {} #define ImuMagEvent(_mag_handler) { \ - MagEvent(foo_handler); \ + MagEvent(foo_handler); \ if (hmc5843.data_available) { \ imu.mag_unscaled.x = hmc5843.data.value[IMU_MAG_X_CHAN]; \ imu.mag_unscaled.y = hmc5843.data.value[IMU_MAG_Y_CHAN]; \