mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 05:03:34 +08:00
Major formatting/whitespace cleanup
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
/**
|
||||
* Namespace encapsulating all device framework classes, functions and data.
|
||||
*/
|
||||
namespace device __EXPORT
|
||||
namespace device __EXPORT
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -276,14 +276,14 @@ public:
|
||||
*/
|
||||
virtual int poll(struct file *filp, struct pollfd *fds, bool setup);
|
||||
|
||||
/**
|
||||
* Test whether the device is currently open.
|
||||
*
|
||||
* This can be used to avoid tearing down a device that is still active.
|
||||
*
|
||||
* @return True if the device is currently open.
|
||||
*/
|
||||
bool is_open() { return _open_count > 0; }
|
||||
/**
|
||||
* Test whether the device is currently open.
|
||||
*
|
||||
* This can be used to avoid tearing down a device that is still active.
|
||||
*
|
||||
* @return True if the device is currently open.
|
||||
*/
|
||||
bool is_open() { return _open_count > 0; }
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
||||
@@ -121,7 +121,7 @@ I2C::transfer(uint8_t *send, unsigned send_len, uint8_t *recv, unsigned recv_len
|
||||
unsigned tries = 0;
|
||||
|
||||
do {
|
||||
// debug("transfer out %p/%u in %p/%u", send, send_len, recv, recv_len);
|
||||
// debug("transfer out %p/%u in %p/%u", send, send_len, recv, recv_len);
|
||||
|
||||
msgs = 0;
|
||||
|
||||
@@ -144,7 +144,7 @@ I2C::transfer(uint8_t *send, unsigned send_len, uint8_t *recv, unsigned recv_len
|
||||
if (msgs == 0)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
/*
|
||||
* I2C architecture means there is an unavoidable race here
|
||||
* if there are any devices on the bus with a different frequency
|
||||
* preference. Really, this is pointless.
|
||||
@@ -154,7 +154,7 @@ I2C::transfer(uint8_t *send, unsigned send_len, uint8_t *recv, unsigned recv_len
|
||||
|
||||
if (ret == OK)
|
||||
break;
|
||||
|
||||
|
||||
// reset the I2C bus to unwedge on error
|
||||
up_i2creset(_dev);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#include <nuttx/i2c.h>
|
||||
|
||||
namespace device __EXPORT
|
||||
namespace device __EXPORT
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@@ -134,6 +134,7 @@ SPI::transfer(uint8_t *send, uint8_t *recv, unsigned len)
|
||||
/* do common setup */
|
||||
if (!up_interrupt_context())
|
||||
SPI_LOCK(_dev, true);
|
||||
|
||||
SPI_SETFREQUENCY(_dev, _frequency);
|
||||
SPI_SETMODE(_dev, _mode);
|
||||
SPI_SETBITS(_dev, 8);
|
||||
@@ -144,6 +145,7 @@ SPI::transfer(uint8_t *send, uint8_t *recv, unsigned len)
|
||||
|
||||
/* and clean up */
|
||||
SPI_SELECT(_dev, _device, false);
|
||||
|
||||
if (!up_interrupt_context())
|
||||
SPI_LOCK(_dev, false);
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ protected:
|
||||
* If called from interrupt context, this interface does not lock
|
||||
* the bus and may interfere with non-interrupt-context callers.
|
||||
*
|
||||
* Clients in a mixed interrupt/non-interrupt configuration must
|
||||
* Clients in a mixed interrupt/non-interrupt configuration must
|
||||
* ensure appropriate interlocking.
|
||||
*
|
||||
* At least one of send or recv must be non-null.
|
||||
|
||||
Reference in New Issue
Block a user