42 #include <px4_platform_common/px4_config.h> 43 #include <px4_platform_common/tasks.h> 45 #include <sys/types.h> 53 #include <arch/board/board.h> 63 int uart_usb = open(
"/dev/ttyACM0", O_RDONLY | O_NOCTTY);
67 read(uart_usb, &c, 1);
78 int uart_usb = open(
"/dev/ttyACM0", O_WRONLY | O_NOCTTY);
81 printf(
"ERROR opening /dev/ttyACM0. Do you need to run sercon first? Aborting..\n");
85 uint8_t sample_uart_usb[] = {
'S',
'A',
'M',
'P',
'L',
'E',
' ',
'\n'};
87 pthread_t receive_thread;
89 pthread_create(&receive_thread, NULL,
receive_loop, NULL);
92 pthread_join(receive_thread, NULL);
94 for (
int i = 0; i < 30; i++) {
95 write(uart_usb, sample_uart_usb,
sizeof(sample_uart_usb));
High-resolution timer with callouts and timekeeping.
static void read(bootloader_app_shared_t *pshared)
int test_uart_console(int argc, char *argv[])
static void write(bootloader_app_shared_t *pshared)
static void * receive_loop(void *arg)