41 #include <px4_platform_common/px4_config.h> 43 #include <sys/types.h> 51 #include <arch/board/board.h> 63 char *uart_name =
"/dev/ttyS3";
65 if (argc > 1) { uart_name = argv[1]; }
68 int test_uart = open(uart_name, O_RDWR | O_NONBLOCK | O_NOCTTY);
71 printf(
"ERROR opening UART %s, aborting..\n", uart_name);
75 printf(
"Writing to UART %s\n", uart_name);
78 char sample_test_uart[25];
84 for (i = 0; i < 30000; i++) {
85 n = sprintf(sample_test_uart,
"SAMPLE #%d\n", i);
86 write(test_uart, sample_test_uart, n);
91 int bytes = i *
sizeof(sample_test_uart);
93 printf(
"Wrote %d bytes in %d ms on UART %s\n", bytes, interval / 1000, uart_name);
High-resolution timer with callouts and timekeeping.
int test_uart_send(int argc, char *argv[])
static void write(bootloader_app_shared_t *pshared)
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).