px4io: add support for test_motor

And fix some IO bugs:
- PX4IO_P_STATUS_FLAGS_RAW_PWM was never cleared. This meant that after a
  'pwm test' command, normal mixing was not possible anymore.
  Fixed by remembering when we are in test mode and not sending
  PX4IO_PAGE_CONTROLS during that time. PX4IO_P_STATUS_FLAGS_RAW_PWM is
  cleared when PX4IO_PAGE_CONTROLS are received.
- when entering test mode w/o specifying all channels, the other channels
  were not set at all, which means they could still be set to values from
  a previous test call.
  This is fixed by setting all channels to disarmed when entering/leaving
  test mode.
This commit is contained in:
Beat Küng
2019-10-24 09:27:29 +02:00
parent 0d91d4e702
commit 02833c6075
2 changed files with 108 additions and 5 deletions
+2
View File
@@ -291,6 +291,8 @@ registers_set(uint8_t page, uint8_t offset, const uint16_t *values, unsigned num
values++;
}
r_status_flags &= ~PX4IO_P_STATUS_FLAGS_RAW_PWM;
system_state.fmu_data_received_time = hrt_absolute_time();
break;