mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
Tidy up the write path.
This commit is contained in:
@@ -1085,18 +1085,16 @@ ssize_t
|
|||||||
PX4IO::write(file *filp, const char *buffer, size_t len)
|
PX4IO::write(file *filp, const char *buffer, size_t len)
|
||||||
{
|
{
|
||||||
unsigned count = len / 2;
|
unsigned count = len / 2;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (count > 0) {
|
|
||||||
if (count > _max_actuators)
|
if (count > _max_actuators)
|
||||||
count = _max_actuators;
|
count = _max_actuators;
|
||||||
ret = io_reg_set(PX4IO_PAGE_DIRECT_PWM, 0, (uint16_t *)buffer, count);
|
if (count > 0) {
|
||||||
} else {
|
int ret = io_reg_set(PX4IO_PAGE_DIRECT_PWM, 0, (uint16_t *)buffer, count);
|
||||||
ret = -EINVAL;
|
if (ret != OK)
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
return count * 2;
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" __EXPORT int px4io_main(int argc, char *argv[]);
|
extern "C" __EXPORT int px4io_main(int argc, char *argv[]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user