MAVLink: Improve switch handling

This commit is contained in:
Lorenz Meier 2015-09-04 19:58:04 +02:00
parent be92c1189b
commit 86d1e38f7a
1 changed files with 1 additions and 1 deletions

View File

@ -991,7 +991,7 @@ switch_pos_t
MavlinkReceiver::decode_switch_pos(uint16_t buttons, unsigned sw)
{
// This 2-bit method should be used in the future: (buttons >> (sw * 2)) & 3;
return (buttons & (1 << sw));
return (buttons & (1 << sw)) ? manual_control_setpoint_s::SWITCH_POS_ON : manual_control_setpoint_s::SWITCH_POS_OFF;
}
int