1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

LP-479 Addressed PR comments

This commit is contained in:
Vladimir Zidar 2017-04-21 14:54:21 +02:00
parent 3b39f1b4ce
commit 50fce728f8
5 changed files with 15 additions and 9 deletions

View File

@ -961,6 +961,7 @@ static bool set_channel(uint8_t mixer_channel, uint16_t value)
PIOS_Servo_Set(actuatorSettings.ChannelAddr[mixer_channel], (value * ACTUATOR_MULTISHOT_PULSE_FACTOR) - 180);
break;
case ACTUATORSETTINGS_BANKMODE_DSHOT:
// Remap 0-2000 range to: 0 = disarmed, 1 to 47 = Reserved for special commands, 48 to 2047 = Active throttle control.
if (value > 0) {
value += 47; /* skip over reserved values */
}

View File

@ -28,6 +28,10 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* DShot: Tribute belongs to dRonin, http://dRonin.org/ for sparking the idea of
* using gpio bitbang as more general solution over using timer dma.
*/
#include "pios.h"
@ -233,7 +237,7 @@ int32_t PIOS_Servo_Init(const struct pios_servo_cfg *cfg)
memset(pios_servo_pins, 0, sizeof(*pios_servo_pins) * cfg->num_channels);
/* set default dshot timinig */
/* set default dshot timing */
PIOS_Servo_DSHot_Rate(300);

View File

@ -405,7 +405,7 @@ void ConfigOutputWidget::refreshWidgetsValuesImpl(UAVObject *obj)
setChannelLimits(outputChannelForm, &bankControls);
outputChannelForm->setBank(QString("%1").arg(bankNumber));
outputChannelForm->setBank(QString::number(bankNumber));
outputChannelForm->setColor(bankControls.color());
i++;
@ -499,8 +499,9 @@ void ConfigOutputWidget::setChannelLimits(OutputChannelForm *channelForm, Output
// case ActuatorSettings::BANKMODE_BRUSHED:
// channelForm->setLimits(0, 0, 0, 100); // 0 to 100%
// break;
default:;
default:
channelForm->setLimits(MINOUTPUT_VALUE, MAXOUTPUT_VALUE, MINOUTPUT_VALUE, MAXOUTPUT_VALUE);
break;
}
}

View File

@ -206,12 +206,12 @@ void OutputChannelForm::setNeutral(int value)
*
* Set
*/
void OutputChannelForm::setLimits(int min_low, int min_high, int max_low, int max_high)
void OutputChannelForm::setLimits(int actuatorMinMinimum, int actuatorMinMaximum, int actuatorMaxMinimum, int actuatorMaxMaximum)
{
ui->actuatorMin->setMaximum(min_high);
ui->actuatorMax->setMaximum(max_high);
ui->actuatorMin->setMinimum(min_low);
ui->actuatorMax->setMinimum(max_low);
ui->actuatorMin->setMaximum(actuatorMinMaximum);
ui->actuatorMax->setMaximum(actuatorMaxMaximum);
ui->actuatorMin->setMinimum(actuatorMinMinimum);
ui->actuatorMax->setMinimum(actuatorMaxMinimum);
}
/**

View File

@ -62,7 +62,7 @@ public slots:
void setRange(int minimum, int maximum);
void enableChannelTest(bool state);
QString outputMixerType();
void setLimits(int min_low, int min_high, int max_low, int max_high);
void setLimits(int actuatorMinMinimum, int actuatorMinMaximum, int actuatorMaxMinimum, int actuatorMaxMaximum);
signals:
void channelChanged(int index, int value);