mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 21:23:33 +08:00
POSIX: ported systemcmds/tests
Most of the systemcmds tests run in the posix build. The UART tests fail for me as I do not have a UART connected. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_config.h>
|
||||
#include <px4_posix.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -45,9 +46,8 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/analog/adc.h>
|
||||
#include <px4_adc.h>
|
||||
|
||||
#include "tests.h"
|
||||
|
||||
@@ -93,7 +93,7 @@ int test_gpio(int argc, char *argv[])
|
||||
|
||||
#ifdef PX4IO_DEVICE_PATH
|
||||
|
||||
int fd = open(PX4IO_DEVICE_PATH, 0);
|
||||
int fd = px4_open(PX4IO_DEVICE_PATH, 0);
|
||||
|
||||
if (fd < 0) {
|
||||
printf("GPIO: open fail\n");
|
||||
@@ -101,16 +101,16 @@ int test_gpio(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* set all GPIOs to default state */
|
||||
ioctl(fd, GPIO_RESET, ~0);
|
||||
px4_ioctl(fd, GPIO_RESET, ~0);
|
||||
|
||||
|
||||
/* XXX need to add some GPIO waving stuff here */
|
||||
|
||||
|
||||
/* Go back to default */
|
||||
ioctl(fd, GPIO_RESET, ~0);
|
||||
px4_ioctl(fd, GPIO_RESET, ~0);
|
||||
|
||||
close(fd);
|
||||
px4_close(fd);
|
||||
printf("\t GPIO test successful.\n");
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user