diff --git a/test_node/app/src/threads/rc.c b/test_node/app/src/threads/rc.c index 0c9d5aa0..43689e43 100644 --- a/test_node/app/src/threads/rc.c +++ b/test_node/app/src/threads/rc.c @@ -18,7 +18,10 @@ bool rc_command_received(rc_data_t command) { // atomic_set(&latest_rc_command, (atomic_t)); // send the command over the UART interface // 'I' means idle - // order should (i think) be 1. [L/R] 2. [F/B] 3. [U/D] + // order should (i think) be 1. [U/D] 2. [L/R] 3. [F/B] + + uart_poll_out(uart_dev, command.rc_vert); + if(command.rc_horiz == 'F' || command.rc_horiz == 'B') { uart_poll_out(uart_dev, 'I'); uart_poll_out(uart_dev, command.rc_horiz); @@ -27,8 +30,6 @@ bool rc_command_received(rc_data_t command) { uart_poll_out(uart_dev, 'I'); } - uart_poll_out(uart_dev, command.rc_vert); - return true; } @@ -39,6 +40,11 @@ int rc_init(const struct device* dev) { return -1; } + // send an initial UP command to DUT to start in hover state + uart_poll_out(dev, 'U'); + uart_poll_out(dev, 'I'); + uart_poll_out(dev, 'I'); + uart_dev = dev; return 0; }