Merge pull request #703 from PX4/act_group_hotfix

Actuator group hotfix
This commit is contained in:
Lorenz Meier 2014-03-12 21:56:07 +01:00
commit b9e8690c61
3 changed files with 8 additions and 6 deletions

View File

@ -1921,12 +1921,14 @@ PX4IO::print_status()
io_reg_get(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_PWM_ALTRATE)); io_reg_get(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_PWM_ALTRATE));
#endif #endif
printf("debuglevel %u\n", io_reg_get(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_SET_DEBUG)); printf("debuglevel %u\n", io_reg_get(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_SET_DEBUG));
printf("controls"); for (unsigned group = 0; group < 4; group++) {
printf("controls %u:", group);
for (unsigned i = 0; i < _max_controls; i++) for (unsigned i = 0; i < _max_controls; i++)
printf(" %u", io_reg_get(PX4IO_PAGE_CONTROLS, i)); printf(" %d", (int16_t) io_reg_get(PX4IO_PAGE_CONTROLS, group * PX4IO_PROTOCOL_MAX_CONTROL_COUNT + i));
printf("\n"); printf("\n");
}
for (unsigned i = 0; i < _max_rc_input; i++) { for (unsigned i = 0; i < _max_rc_input; i++) {
unsigned base = PX4IO_P_RC_CONFIG_STRIDE * i; unsigned base = PX4IO_P_RC_CONFIG_STRIDE * i;

View File

@ -267,7 +267,7 @@ mixer_callback(uintptr_t handle,
uint8_t control_index, uint8_t control_index,
float &control) float &control)
{ {
if (control_group > 3) if (control_group >= PX4IO_CONTROL_GROUPS)
return -1; return -1;
switch (source) { switch (source) {

View File

@ -53,7 +53,7 @@
*/ */
#define PX4IO_SERVO_COUNT 8 #define PX4IO_SERVO_COUNT 8
#define PX4IO_CONTROL_CHANNELS 8 #define PX4IO_CONTROL_CHANNELS 8
#define PX4IO_CONTROL_GROUPS 2 #define PX4IO_CONTROL_GROUPS 4
#define PX4IO_RC_INPUT_CHANNELS 18 #define PX4IO_RC_INPUT_CHANNELS 18
#define PX4IO_RC_MAPPED_CONTROL_CHANNELS 8 /**< This is the maximum number of channels mapped/used */ #define PX4IO_RC_MAPPED_CONTROL_CHANNELS 8 /**< This is the maximum number of channels mapped/used */