mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
OP-493: Force three AccessoryDesired objects to always exist. Routing to
Mixing channel now works. However Accessory desired instances do not show up in GCS.
This commit is contained in:
parent
468b7b562d
commit
99b3a629a8
@ -171,6 +171,11 @@ static void manualControlTask(void *parameters)
|
||||
uint8_t disconnected_count = 0;
|
||||
uint8_t connected_count = 0;
|
||||
|
||||
// For now manual instantiate extra instances of Accessory Desired. In future should be done dynamically
|
||||
// this includes not even registering it if not used
|
||||
AccessoryDesiredCreateInstance();
|
||||
AccessoryDesiredCreateInstance();
|
||||
|
||||
// Make sure unarmed on power up
|
||||
ManualControlCommandGet(&cmd);
|
||||
FlightStatusGet(&flightStatus);
|
||||
@ -268,18 +273,24 @@ static void manualControlTask(void *parameters)
|
||||
flightMode = scaledChannel[settings.FlightMode];
|
||||
|
||||
AccessoryDesiredData accessory;
|
||||
// Set Accessory 0
|
||||
if(settings.Accessory0 != MANUALCONTROLSETTINGS_ACCESSORY0_NONE) {
|
||||
accessory.AccessoryVal = scaledChannel[settings.Accessory0];
|
||||
if(AccessoryDesiredInstSet(0, &accessory) != 0)
|
||||
AlarmsSet(SYSTEMALARMS_ALARM_MANUALCONTROL, SYSTEMALARMS_ALARM_WARNING);
|
||||
}
|
||||
// Set Accessory 1
|
||||
accessory.AccessoryVal = scaledChannel[settings.Accessory1];
|
||||
if(AccessoryDesiredInstSet(0, &accessory) != 0)
|
||||
AccessoryDesiredCreateInstance();
|
||||
// Set Accessory 2
|
||||
accessory.AccessoryVal = scaledChannel[settings.Accessory2];
|
||||
if(AccessoryDesiredInstSet(1, &accessory) != 0)
|
||||
AccessoryDesiredCreateInstance();
|
||||
// Set Accsesory 3
|
||||
accessory.AccessoryVal = scaledChannel[settings.Accessory3];
|
||||
if(AccessoryDesiredInstSet(2, &accessory) != 0)
|
||||
AccessoryDesiredCreateInstance();
|
||||
if(settings.Accessory1 != MANUALCONTROLSETTINGS_ACCESSORY1_NONE) {
|
||||
accessory.AccessoryVal = scaledChannel[settings.Accessory1];
|
||||
if(AccessoryDesiredInstSet(1, &accessory) != 0)
|
||||
AlarmsSet(SYSTEMALARMS_ALARM_MANUALCONTROL, SYSTEMALARMS_ALARM_WARNING);
|
||||
}
|
||||
// Set Accsesory 2
|
||||
if(settings.Accessory2 != MANUALCONTROLSETTINGS_ACCESSORY2_NONE) {
|
||||
accessory.AccessoryVal = scaledChannel[settings.Accessory2];
|
||||
if(AccessoryDesiredInstSet(2, &accessory) != 0)
|
||||
AlarmsSet(SYSTEMALARMS_ALARM_MANUALCONTROL, SYSTEMALARMS_ALARM_WARNING);
|
||||
}
|
||||
|
||||
|
||||
processFlightMode(&settings, flightMode);
|
||||
|
@ -1,7 +1,7 @@
|
||||
define connect
|
||||
target remote localhost:3333
|
||||
monitor cortex_m3 vector_catch all
|
||||
file ./build/coptercontrol/CopterControl.elf
|
||||
file ./build/fw_coptercontrol/fw_coptercontrol.elf
|
||||
end
|
||||
#monitor reset halt
|
||||
|
||||
|
@ -7,9 +7,9 @@
|
||||
<field name="Yaw" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="Channel3"/>
|
||||
<field name="Throttle" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="Channel4"/>
|
||||
<field name="FlightMode" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="Channel5"/>
|
||||
<field name="Accessory0" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="Accessory1" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="Accessory2" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="Accessory3" units="channel" type="enum" elements="1" options="Channel1,Channel2,Channel3,Channel4,Channel5,Channel6,Channel7,Channel8,None" defaultvalue="None"/>
|
||||
<field name="Arming" units="" type="enum" elements="1" options="Always Disarmed,Always Armed,Roll Left,Roll Right,Pitch Forward,Pitch Aft,Yaw Left,Yaw Right" defaultvalue="Always Disarmed"/>
|
||||
|
||||
<!-- Note these options should be identical to those in StabilizationDesired.StabilizationMode -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user