mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
lib/drivers/nuttx/ I2C SPI:Use inttypes
This commit is contained in:
committed by
Julian Oes
parent
ff2748ba53
commit
b4ebc68a40
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2012-2020 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2012-2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -114,7 +114,7 @@ I2C::init()
|
||||
if (_bus_clocks[bus_index] > _frequency) {
|
||||
(void)px4_i2cbus_uninitialize(_dev);
|
||||
_dev = nullptr;
|
||||
DEVICE_LOG("FAIL: too slow for bus #%u: %u KHz, device max: %u KHz)",
|
||||
DEVICE_LOG("FAIL: too slow for bus #%u: %u KHz, device max: %" PRIu32 " KHz)",
|
||||
get_device_bus(), _bus_clocks[bus_index] / 1000, _frequency / 1000);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
@@ -153,7 +153,7 @@ I2C::init()
|
||||
}
|
||||
|
||||
// tell the world where we are
|
||||
DEVICE_DEBUG("on I2C bus %d at 0x%02x (bus: %u KHz, max: %u KHz)",
|
||||
DEVICE_DEBUG("on I2C bus %d at 0x%02x (bus: %u KHz, max: %" PRIu32 " KHz)",
|
||||
get_device_bus(), get_device_address(), _bus_clocks[bus_index] / 1000, _frequency / 1000);
|
||||
|
||||
out:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2012-2019 PX4 Development Team. All rights reserved.
|
||||
* Copyright (C) 2012-2019, 2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -120,7 +120,8 @@ SPI::init()
|
||||
}
|
||||
|
||||
/* tell the world where we are */
|
||||
DEVICE_DEBUG("on SPI bus %d at %d (%u KHz)", get_device_bus(), PX4_SPI_DEV_ID(_device), _frequency / 1000);
|
||||
DEVICE_DEBUG("on SPI bus %d at %" PRId32 " (%" PRId32 " KHz)", get_device_bus(), PX4_SPI_DEV_ID(_device),
|
||||
_frequency / 1000);
|
||||
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user