mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 07:53:43 +08:00
[lisa_m] fix test_baro, remove trailing whitespaces and fix indentation in baro_board*
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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/
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user