drivers: Fix compile warnings and non-standard performance counter names

This commit is contained in:
Lorenz Meier 2014-05-21 14:20:48 +02:00
parent fb801b6fae
commit aa312f96f8
5 changed files with 6 additions and 10 deletions

View File

@ -1380,7 +1380,6 @@ MPU6000_gyro::init()
_gyro_class_instance = register_class_devname(GYRO_DEVICE_PATH); _gyro_class_instance = register_class_devname(GYRO_DEVICE_PATH);
out:
return ret; return ret;
} }

View File

@ -753,8 +753,8 @@ MS5611::print_info()
printf("TEMP: %d\n", _TEMP); printf("TEMP: %d\n", _TEMP);
printf("SENS: %lld\n", _SENS); printf("SENS: %lld\n", _SENS);
printf("OFF: %lld\n", _OFF); printf("OFF: %lld\n", _OFF);
printf("P: %.3f\n", _P); printf("P: %.3f\n", (double)_P);
printf("T: %.3f\n", _T); printf("T: %.3f\n", (double)_T);
printf("MSL pressure: %10.4f\n", (double)(_msl_pressure / 100.f)); printf("MSL pressure: %10.4f\n", (double)(_msl_pressure / 100.f));
printf("factory_setup %u\n", _prom.factory_setup); printf("factory_setup %u\n", _prom.factory_setup);

View File

@ -639,7 +639,7 @@ PX4IO_serial::_do_interrupt()
if (_rx_dma_status == _dma_status_waiting) { if (_rx_dma_status == _dma_status_waiting) {
/* verify that the received packet is complete */ /* verify that the received packet is complete */
unsigned length = sizeof(_dma_buffer) - stm32_dmaresidual(_rx_dma); int length = sizeof(_dma_buffer) - stm32_dmaresidual(_rx_dma);
if ((length < 1) || (length < PKT_SIZE(_dma_buffer))) { if ((length < 1) || (length < PKT_SIZE(_dma_buffer))) {
perf_count(_pc_badidle); perf_count(_pc_badidle);

View File

@ -254,9 +254,6 @@ SF0X::~SF0X()
int int
SF0X::init() SF0X::init()
{ {
int ret = ERROR;
unsigned i = 0;
/* do regular cdev init */ /* do regular cdev init */
if (CDev::init() != OK) { if (CDev::init() != OK) {
goto out; goto out;
@ -594,7 +591,7 @@ SF0X::collect()
valid = false; valid = false;
/* wipe out partially read content from last cycle(s), check for dot */ /* wipe out partially read content from last cycle(s), check for dot */
for (int i = 0; i < (lend - 2); i++) { for (unsigned i = 0; i < (lend - 2); i++) {
if (_linebuf[i] == '\n') { if (_linebuf[i] == '\n') {
char buf[sizeof(_linebuf)]; char buf[sizeof(_linebuf)];
memcpy(buf, &_linebuf[i+1], (lend + 1) - (i + 1)); memcpy(buf, &_linebuf[i+1], (lend + 1) - (i + 1));
@ -795,7 +792,7 @@ const int ERROR = -1;
SF0X *g_dev; SF0X *g_dev;
void start(); void start(const char *port);
void stop(); void stop();
void test(); void test();
void reset(); void reset();

View File

@ -145,7 +145,7 @@ private:
ADC::ADC(uint32_t channels) : ADC::ADC(uint32_t channels) :
CDev("adc", ADC_DEVICE_PATH), CDev("adc", ADC_DEVICE_PATH),
_sample_perf(perf_alloc(PC_ELAPSED, "ADC samples")), _sample_perf(perf_alloc(PC_ELAPSED, "adc_samples")),
_channel_count(0), _channel_count(0),
_samples(nullptr), _samples(nullptr),
_to_system_power(0) _to_system_power(0)