mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 02:41:35 +08:00
fix reading baro values from simulator
This commit is contained in:
@@ -127,7 +127,7 @@ BARO_SIM::dev_read(unsigned offset, void *data, unsigned count)
|
||||
|
||||
/* read the most recent measurement */
|
||||
uint8_t cmd = 0;
|
||||
int ret = transfer(&cmd, 1, static_cast<uint8_t *>(data), 3);
|
||||
int ret = transfer(&cmd, 1, static_cast<uint8_t *>(data), count);
|
||||
|
||||
/*
|
||||
if (ret == PX4_OK) {
|
||||
@@ -208,7 +208,7 @@ BARO_SIM::transfer(const uint8_t *send, unsigned send_len,
|
||||
if (recv_len == 0) {
|
||||
PX4_DEBUG("BARO_SIM measurement requested");
|
||||
}
|
||||
else if (send_len != 1 || send[0] != 0 || recv_len != 3) {
|
||||
else if (send_len != 1 || send[0] != 0 ) {
|
||||
PX4_WARN("BARO_SIM::transfer invalid param %u %u %u", send_len, send[0], recv_len);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user