mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-05 04:00:34 +08:00
drivers:batt_smbus Use inttypes
This commit is contained in:
committed by
Julian Oes
parent
05007944f1
commit
3a0770499a
@@ -52,8 +52,8 @@ BATT_SMBUS::BATT_SMBUS(I2CSPIBusOption bus_option, const int bus, SMBus *interfa
|
||||
interface->get_device_address()),
|
||||
_interface(interface)
|
||||
{
|
||||
int battsource = 1;
|
||||
int batt_device_type = (int)SMBUS_DEVICE_TYPE::UNDEFINED;
|
||||
int32_t battsource = 1;
|
||||
int32_t batt_device_type = static_cast<int32_t>(SMBUS_DEVICE_TYPE::UNDEFINED);
|
||||
|
||||
param_set(param_find("BAT_SOURCE"), &battsource);
|
||||
param_get(param_find("BAT_SMBUS_MODEL"), &batt_device_type);
|
||||
@@ -84,7 +84,7 @@ BATT_SMBUS::~BATT_SMBUS()
|
||||
delete _interface;
|
||||
}
|
||||
|
||||
int battsource = 0;
|
||||
int32_t battsource = 0;
|
||||
param_set(param_find("BAT_SOURCE"), &battsource);
|
||||
}
|
||||
|
||||
@@ -567,8 +567,8 @@ BATT_SMBUS::custom_method(const BusCLIArguments &cli)
|
||||
switch(cli.custom1) {
|
||||
case 1: {
|
||||
PX4_INFO("The manufacturer name: %s", _manufacturer_name);
|
||||
PX4_INFO("The manufacturer date: %d", _manufacture_date);
|
||||
PX4_INFO("The serial number: %d", _serial_number);
|
||||
PX4_INFO("The manufacturer date: %" PRId16, _manufacture_date);
|
||||
PX4_INFO("The serial number: %d" PRId16, _serial_number);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
@@ -590,7 +590,7 @@ BATT_SMBUS::custom_method(const BusCLIArguments &cli)
|
||||
unsigned length = tx_buf[0];
|
||||
|
||||
if (PX4_OK != dataflash_write(address, tx_buf+1, length)) {
|
||||
PX4_ERR("Dataflash write failed: %d", address);
|
||||
PX4_ERR("Dataflash write failed: %u", address);
|
||||
}
|
||||
px4_usleep(100_ms);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user