mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 08:23:34 +08:00
clang-tidy: partially fix hicpp-use-equals-delete
This commit is contained in:
@@ -59,6 +59,12 @@ class __EXPORT I2C : public CDev
|
||||
|
||||
public:
|
||||
|
||||
// no copy, assignment, move, move assignment
|
||||
I2C(const I2C &) = delete;
|
||||
I2C &operator=(const I2C &) = delete;
|
||||
I2C(I2C &&) = delete;
|
||||
I2C &operator=(I2C &&) = delete;
|
||||
|
||||
virtual int init();
|
||||
|
||||
static int set_bus_clock(unsigned bus, unsigned clock_hz);
|
||||
@@ -109,8 +115,6 @@ private:
|
||||
uint32_t _frequency{0};
|
||||
px4_i2c_dev_t *_dev{nullptr};
|
||||
|
||||
I2C(const device::I2C &);
|
||||
I2C operator=(const device::I2C &);
|
||||
};
|
||||
|
||||
} // namespace device
|
||||
|
||||
@@ -50,6 +50,13 @@ namespace device __EXPORT
|
||||
*/
|
||||
class __EXPORT SPI : public CDev
|
||||
{
|
||||
public:
|
||||
// no copy, assignment, move, move assignment
|
||||
SPI(const SPI &) = delete;
|
||||
SPI &operator=(const SPI &) = delete;
|
||||
SPI(SPI &&) = delete;
|
||||
SPI &operator=(SPI &&) = delete;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Constructor
|
||||
@@ -152,10 +159,6 @@ private:
|
||||
|
||||
LockMode _locking_mode{LOCK_THREADS}; /**< selected locking mode */
|
||||
|
||||
/* this class does not allow copying */
|
||||
SPI(const SPI &);
|
||||
SPI operator=(const SPI &);
|
||||
|
||||
protected:
|
||||
int _transfer(uint8_t *send, uint8_t *recv, unsigned len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user