From 1e99a7125c65b4302c5e39d2a518e731eccda598 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Mon, 13 Jun 2016 19:00:30 -0300 Subject: [PATCH] AP_InertialSensor: MPU9250: remove _register_write_check() That function isn't used in the code base and there should be a better way to debug writes on registers. --- .../AP_InertialSensor_MPU9250.cpp | 16 ---------------- .../AP_InertialSensor_MPU9250.h | 1 - 2 files changed, 17 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp index 8faba7f7bb..e6bd3f76ce 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp @@ -456,22 +456,6 @@ void AP_InertialSensor_MPU9250::_register_write(uint8_t reg, uint8_t val) _dev->write_register(reg, val); } -/* - useful when debugging SPI bus errors - */ -void AP_InertialSensor_MPU9250::_register_write_check(uint8_t reg, uint8_t val) -{ - uint8_t readed; - _register_write(reg, val); - readed = _register_read(reg); - if (readed != val){ - hal.console->printf("Values doesn't match; written: %02x; read: %02x ", val, readed); - } -#if MPU9250_DEBUG - hal.console->printf("Values written: %02x; readed: %02x ", val, readed); -#endif -} - bool AP_InertialSensor_MPU9250::_hardware_init(void) { if (!_dev->get_semaphore()->take(100)) { diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.h b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.h index 54a702b147..c0ce91eebb 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.h @@ -84,7 +84,6 @@ private: bool _block_read(uint8_t reg, uint8_t *buf, uint32_t size); uint8_t _register_read(uint8_t reg); void _register_write(uint8_t reg, uint8_t val); - void _register_write_check(uint8_t reg, uint8_t val); void _accumulate(uint8_t *sample);