mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-12-02 22:40:27 +08:00
feat(AUAV): pr-comment
This commit is contained in:
1 parent
1ad1d0cef7
commit
3c0d848602
3 files changed
+5
-4
No files matched your search
@@ -59,12 +59,12 @@ I2CSPIDriverBase *AUAV::instantiate(const I2CSPIDriverConfig &config, const int
|
||||
return instance;
|
||||
}
|
||||
|
||||
AUAV::AUAV(const I2CSPIDriverConfig &config, const uint8_t status_byte_expected) :
|
||||
AUAV::AUAV(const I2CSPIDriverConfig &config, const uint8_t status_byte) :
|
||||
I2C(config),
|
||||
I2CSPIDriver(config),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": read")),
|
||||
_comms_errors(perf_alloc(PC_COUNT, MODULE_NAME": comms errors")),
|
||||
_status_byte(status_byte_expected)
|
||||
_status_byte(status_byte)
|
||||
{
|
||||
I2C::_retries = 5;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ static constexpr uint32_t I2C_SPEED = 100 * 1000; // 100 kHz I2C serial interfac
|
||||
class AUAV : public device::I2C, public I2CSPIDriver<AUAV>
|
||||
{
|
||||
public:
|
||||
explicit AUAV(const I2CSPIDriverConfig &config, const uint8_t status_byte_expected);
|
||||
explicit AUAV(const I2CSPIDriverConfig &config, const uint8_t status_byte);
|
||||
virtual ~AUAV();
|
||||
|
||||
static I2CSPIDriverBase *instantiate(const I2CSPIDriverConfig &config, const int runtime_instance);
|
||||
@@ -131,7 +131,7 @@ protected:
|
||||
* bit 0: ALU error (0 = ok)
|
||||
* bit 1: reserved (0)
|
||||
* bit 2: memory error (0 = ok)
|
||||
* bit 3-4: mode (differential: 0x10, absolute: 0x00)
|
||||
* bit 3-4: mode (differential: 0b01, absolute: 0b00)
|
||||
* bit 5: busy (0 = measurement ready)
|
||||
* bit 6: power on (1)
|
||||
* bit 7: reserved (0)
|
||||
|
||||
@@ -55,6 +55,7 @@ static constexpr int64_t DIFF_CONVERSION_INTERVAL = (1000000 / DIFF_MEAS_RATE);
|
||||
/* reading too fast can yield all zero data -> incorrect sensor reading */
|
||||
static_assert(DIFF_CONVERSION_INTERVAL >= 7000, "Conversion interval is too fast");
|
||||
|
||||
/* Status byte of a completed reading without error */
|
||||
static constexpr uint8_t STATUS_BYTE_DIFF = 0x50;
|
||||
|
||||
/* Valid AUAV types */
|
||||
|
||||
Reference in new issue
Block a user