Skip to content

Commit

Permalink
add crsf-bind button
Browse files Browse the repository at this point in the history
  • Loading branch information
benjinne committed Nov 16, 2024
1 parent 969696c commit 477b69a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/AutoPilotPlugins/Common/RadioComponent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,14 @@ SetupPage {
onClicked: spektrumBindDialogComponent.createObject(mainWindow).open()
}

QGCButton {
text: qsTr("CRSF Bind")
onClicked: mainWindow.showMessageDialog(qsTr("CRSF Bind"),
qsTr("Click Ok to place your CRSF receiver in the bind mode."),
Dialog.Ok | Dialog.Cancel,
function() { controller.crsfBindMode() })
}

QGCButton {
text: qsTr("Copy Trims")
onClicked: mainWindow.showMessageDialog(qsTr("Copy Trims"),
Expand Down
5 changes: 5 additions & 0 deletions src/AutoPilotPlugins/Common/RadioComponentController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,11 @@ void RadioComponentController::spektrumBindMode(int mode)
_vehicle->pairRX(0, mode);
}

void RadioComponentController::crsfBindMode()
{
_vehicle->pairRX(1, 0);
}

/// @brief Validates the current settings against the calibration rules resetting values as necessary.
void RadioComponentController::_validateCalibration(void)
{
Expand Down
1 change: 1 addition & 0 deletions src/AutoPilotPlugins/Common/RadioComponentController.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class RadioComponentController : public FactPanelController
Q_ENUM(BindModes)

Q_INVOKABLE void spektrumBindMode(int mode);
Q_INVOKABLE void crsfBindMode(void);
Q_INVOKABLE void cancelButtonClicked(void);
Q_INVOKABLE void skipButtonClicked(void);
Q_INVOKABLE void nextButtonClicked(void);
Expand Down

0 comments on commit 477b69a

Please sign in to comment.