File tree Expand file tree Collapse file tree
flight/modules/UAVOMSPBridge Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949#include "airspeedstate.h"
5050#include "actuatorsettings.h"
5151#include "actuatordesired.h"
52+ #include "actuatorcommand.h"
5253#include "flightstatus.h"
5354#include "systemstats.h"
5455#include "systemalarms.h"
@@ -665,6 +666,20 @@ static void msp_send_channels(struct msp_bridge *m)
665666 msp_send (m , MSP_RC , data .buf , sizeof (data ));
666667}
667668
669+ static void msp_send_servo (struct msp_bridge * m )
670+ {
671+ ActuatorCommandData ac ;
672+
673+ ActuatorCommandGet (& ac );
674+
675+ // Only the first 8 channels are supported.
676+ // Channels are 16 bits (2 bytes).
677+ uint8_t channels [16 ];
678+ memcpy (channels , (uint8_t * )ac .Channel , 16 );
679+
680+ msp_send (m , MSP_SERVO , channels , sizeof (channels ));
681+ }
682+
668683static void msp_send_boxids (struct msp_bridge * m ) // This is actually sending a map of MSP_STATUS.flag bits to BOX ids.
669684{
670685 msp_send (m , MSP_BOXIDS , msp_boxes , sizeof (msp_boxes ));
@@ -871,6 +886,9 @@ static msp_state msp_state_checksum(struct msp_bridge *m, uint8_t b)
871886 case MSP_RC :
872887 msp_send_channels (m );
873888 break ;
889+ case MSP_SERVO :
890+ msp_send_servo (m );
891+ break ;
874892 case MSP_BOXIDS :
875893 msp_send_boxids (m );
876894 break ;
You can’t perform that action at this time.
0 commit comments