AP_BoardConfig: removed verbose SPI probe debug messages

these are just confusing for users
This commit is contained in:
Andrew Tridgell 2018-07-13 20:31:35 +10:00
parent 71647cfc6b
commit ed09467f06

View File

@ -112,6 +112,8 @@ void AP_BoardConfig::board_setup_drivers(void)
} }
} }
#define SPI_PROBE_DEBUG 0
/* /*
check a SPI device for a register value check a SPI device for a register value
*/ */
@ -119,7 +121,9 @@ bool AP_BoardConfig::spi_check_register(const char *devname, uint8_t regnum, uin
{ {
auto dev = hal.spi->get_device(devname); auto dev = hal.spi->get_device(devname);
if (!dev) { if (!dev) {
#if SPI_PROBE_DEBUG
hal.console->printf("%s: no device\n", devname); hal.console->printf("%s: no device\n", devname);
#endif
return false; return false;
} }
dev->set_read_flag(read_flag); dev->set_read_flag(read_flag);
@ -128,12 +132,16 @@ bool AP_BoardConfig::spi_check_register(const char *devname, uint8_t regnum, uin
} }
uint8_t v; uint8_t v;
if (!dev->read_registers(regnum, &v, 1)) { if (!dev->read_registers(regnum, &v, 1)) {
#if SPI_PROBE_DEBUG
hal.console->printf("%s: reg %02x read fail\n", devname, (unsigned)regnum); hal.console->printf("%s: reg %02x read fail\n", devname, (unsigned)regnum);
#endif
dev->get_semaphore()->give(); dev->get_semaphore()->give();
return false; return false;
} }
dev->get_semaphore()->give(); dev->get_semaphore()->give();
#if SPI_PROBE_DEBUG
hal.console->printf("%s: reg %02x expected:%02x got:%02x\n", devname, (unsigned)regnum, (unsigned)value, (unsigned)v); hal.console->printf("%s: reg %02x expected:%02x got:%02x\n", devname, (unsigned)regnum, (unsigned)value, (unsigned)v);
#endif
return v == value; return v == value;
} }