[lisa_m] fix test_baro, remove trailing whitespaces and fix indentation in baro_board*

This commit is contained in:
Felix Ruess
2013-01-16 13:29:12 +01:00
parent dd20e2ea8c
commit 64ee11a24c
6 changed files with 21 additions and 20 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ test_baro.srcs += $(COMMON_TELEMETRY_SRCS)
test_baro.CFLAGS += -I$(SRC_LISA) -I$(SRC_BOARD)
test_baro.srcs += $(SRC_BOARD)/test_baro.c
test_baro.srcs += $(SRC_BOARD)/baro_board.c
test_baro.srcs += $(SRC_BOARD)/baro_board_i2c.c
test_baro.CFLAGS += -DUSE_I2C2
test_baro.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c
+4 -4
View File
@@ -1,6 +1,6 @@
/**
/**
* Generic barometer interface, assuming the barometer is read through Aspirin IMU directly
*
*
* Edit by: Michal Podhradsky, michal.podhradsky@aggiemail.usu.edu
* Utah State University, http://aggieair.usu.edu/
*/
@@ -19,6 +19,6 @@ void baro_init(void) {
void baro_periodic(void) {}
void baro_event(void (*b_abs_handler)(void), void (*b_diff_handler)(void)){
b_abs_handler();
b_diff_handler();
b_abs_handler();
b_diff_handler();
}
+2 -2
View File
@@ -1,6 +1,6 @@
/**
/**
* Generic barometer interface, assuming the barometer is read through Aspirin IMU directly
*
*
* Edit by: Michal Podhradsky, michal.podhradsky@aggiemail.usu.edu
* Utah State University, http://aggieair.usu.edu/
*/
+4 -4
View File
@@ -1,6 +1,6 @@
/**
/**
* Measurement Specialties (Intersema) MS5611-01BA pressure/temperature sensor interface for I2C
*
*
* Edit by: Michal Podhradsky, michal.podhradsky@aggiemail.usu.edu
* Utah State University, http://aggieair.usu.edu/
*/
@@ -89,7 +89,7 @@ void baro_periodic(void) {
ms5611_status = MS5611_ADC_D2;
ms5611_trans.buf[0] = MS5611_ADC_READ;
I2CTransceive(MS5611_I2C_DEV, ms5611_trans, MS5611_SLAVE_ADDR, 1, 3);
}
}
else if (ms5611_status == MS5611_UNINIT) {
/* reset sensor */
ms5611_status = MS5611_RESET;
@@ -100,7 +100,7 @@ void baro_periodic(void) {
/* start getting prom data */
ms5611_status = MS5611_PROM;
ms5611_trans.buf[0] = MS5611_PROM_READ | (prom_cnt << 1);
I2CTransceive(MS5611_I2C_DEV, ms5611_trans, MS5611_SLAVE_ADDR, 1, 2);
I2CTransceive(MS5611_I2C_DEV, ms5611_trans, MS5611_SLAVE_ADDR, 1, 2);
}
}
}
+9 -9
View File
@@ -1,6 +1,6 @@
/**
/**
* Measurement Specialties (Intersema) MS5611-01BA pressure/temperature sensor interface for I2C
*
*
* Edit by: Michal Podhradsky, michal.podhradsky@aggiemail.usu.edu
* Utah State University, http://aggieair.usu.edu/
*/
@@ -56,9 +56,9 @@ static int8_t baro_ms5611_crc(uint16_t* prom) {
}
static void trans_cb_ms5611( struct spi_transaction *trans ) {
#ifdef ROTORCRAFT_BARO_LED
RunOnceEvery(10,LED_TOGGLE(ROTORCRAFT_BARO_LED));
#endif
#ifdef ROTORCRAFT_BARO_LED
RunOnceEvery(10,LED_TOGGLE(ROTORCRAFT_BARO_LED));
#endif
}
void baro_init(void) {
@@ -112,7 +112,7 @@ void baro_periodic(void) {
ms5611_status = MS5611_ADC_D2;
ms5611_trans.output_buf[0] = MS5611_ADC_READ;
spi_submit(&(MS5611_SPI_DEV), &ms5611_trans);
}
}
else if (ms5611_status == MS5611_UNINIT) {
/* reset sensor */
ms5611_status = MS5611_RESET;
@@ -123,7 +123,7 @@ void baro_periodic(void) {
/* start getting prom data */
ms5611_status = MS5611_PROM;
ms5611_trans.output_buf[0] = MS5611_PROM_READ | (prom_cnt << 1);
spi_submit(&(MS5611_SPI_DEV), &ms5611_trans);
spi_submit(&(MS5611_SPI_DEV), &ms5611_trans);
}
}
}
@@ -143,7 +143,7 @@ void baro_event(void (*b_abs_handler)(void), void (*b_diff_handler)(void)){
if (prom_cnt < PROM_NB) {//8 bytes at PROM
/* get next prom data */
ms5611_trans.output_buf[0] = MS5611_PROM_READ | (prom_cnt << 1);
spi_submit(&(MS5611_SPI_DEV), &ms5611_trans);
spi_submit(&(MS5611_SPI_DEV), &ms5611_trans);
}
else {
/* done reading prom */
@@ -168,7 +168,7 @@ void baro_event(void (*b_abs_handler)(void), void (*b_diff_handler)(void)){
/* start D2 conversion */
ms5611_status = MS5611_CONV_D2;
ms5611_trans.output_buf[0] = MS5611_START_CONV_D2;
spi_submit(&(MS5611_SPI_DEV), &ms5611_trans);
spi_submit(&(MS5611_SPI_DEV), &ms5611_trans);
break;
case MS5611_ADC_D2: {
+1
View File
@@ -30,6 +30,7 @@
#include "mcu.h"
#include "mcu_periph/sys_time.h"
#include "mcu_periph/uart.h"
#include "mcu_periph/i2c.h"
#include "led.h"
#include "subsystems/datalink/downlink.h"