1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

LP-72 Move i2c devices to flexiport

This commit is contained in:
Laurent Lalanne 2016-05-22 12:37:02 +02:00
parent 46ebc6f5da
commit aa582a658e
4 changed files with 2990 additions and 292 deletions

View File

@ -47,6 +47,8 @@ void AirSpeedPage::initializePage(VehicleConfigurationSource *settings)
settings->getInputType() == VehicleConfigurationSource::INPUT_SRXL ||
settings->getInputType() == VehicleConfigurationSource::INPUT_HOTT_SUMD ||
settings->getInputType() == VehicleConfigurationSource::INPUT_EXBUS)) ||
(isSparky && (settings->getInputType() == VehicleConfigurationSource::INPUT_HOTT_SUMD ||
settings->getInputType() == VehicleConfigurationSource::INPUT_EXBUS)) ||
settings->getGpsType() == VehicleConfigurationSource::GPS_UBX_FLEXI_I2CMAG) {
// Disable non estimated sensors if ports are taken by receivers or I2C Mag
setItemDisabled(VehicleConfigurationSource::AIRSPEED_EAGLETREE, true);
@ -67,19 +69,12 @@ bool AirSpeedPage::validatePage(SelectionItem *selectedItem)
void AirSpeedPage::setupSelection(Selection *selection)
{
QString i2cPortWarning = tr("Note: if previously selected input combinations use the Flexi-port for input, "
"only estimated airspeed will be available.\n\n");
QString i2cPortText = tr("Selecting this option will set your board's Flexi-Port in to I2C mode.");
if (getWizard()->getControllerType() == SetupWizard::CONTROLLER_SPARKY2) {
i2cPortWarning = tr("Note: if previously selected GPS with I2C auxMag, only estimated airspeed will be available.\n\n");
i2cPortText = tr("Selecting this option will enable your board's I2C-Port.");
}
selection->setTitle(tr("Airspeed Sensor Selection"));
selection->setText(tr("This part of the wizard will help you select and configure a way to obtain "
"airspeed data. Current firmware supports three methods to achieve this, one is a "
"software estimation technique and the other two utilize hardware sensors.\n\n") + i2cPortWarning);
"software estimation technique and the other two utilize hardware sensors.\n\n"
"Note: if previously selected input combinations use the Flexi-port for input, "
"only estimated airspeed will be available.\n\n"));
selection->addItem(tr("Estimated"),
tr("This option uses an intelligent estimation algorithm which utilizes the INS/GPS "
@ -91,13 +86,15 @@ void AirSpeedPage::setupSelection(Selection *selection)
selection->addItem(tr("EagleTree"),
tr("Select this option to use the Airspeed MicroSensor V3 from EagleTree, this is an accurate "
"airspeed sensor that includes on-board Temperature Compensation.\n\n") + i2cPortText,
"airspeed sensor that includes on-board Temperature Compensation.\n\n"
"Selecting this option will set your board's Flexi-Port in to I2C mode."),
"eagletree-speed-sensor",
SetupWizard::AIRSPEED_EAGLETREE);
selection->addItem(tr("MS4525 Based"),
tr("Select this option to use an airspeed sensor based on the MS4525DO pressure transducer "
"from Measurement Specialties. This includes the PixHawk sensor and their clones.\n\n") + i2cPortText,
"from Measurement Specialties. This includes the PixHawk sensor and their clones.\n\n"
"Selecting this option will set your board's Flexi-Port in to I2C mode."),
"ms4525-speed-sensor",
SetupWizard::AIRSPEED_MS4525);
}

View File

@ -39,14 +39,14 @@ void GpsPage::initializePage(VehicleConfigurationSource *settings)
{
// Enable all
setItemDisabled(-1, false);
// sbus is on rcvrport for sparky2, that leaves mainport/flexiport available for gps/auxmag
// it is not even possible to put sbus on mainport on sparky2 because hardware inverter is on rcvrport
// for sparky2: ppm, sbus, and dsm all attach to rcvrport by default
if ((settings->getInputType() == VehicleConfigurationSource::INPUT_SBUS && settings->getControllerType() != VehicleConfigurationSource::CONTROLLER_SPARKY2) ||
(settings->getInputType() == VehicleConfigurationSource::INPUT_DSM && settings->getControllerType() != VehicleConfigurationSource::CONTROLLER_SPARKY2) ||
bool isSparky = (getWizard()->getControllerType() == SetupWizard::CONTROLLER_SPARKY2);
// Sbus, dsm and srxl are on rcvrport for sparky2, that leaves mainport/flexiport available for gps/auxmag
if ((!isSparky && (settings->getInputType() == VehicleConfigurationSource::INPUT_SBUS)) ||
(!isSparky && (settings->getInputType() == VehicleConfigurationSource::INPUT_DSM)) ||
(!isSparky && (settings->getInputType() == VehicleConfigurationSource::INPUT_SRXL)) ||
settings->getInputType() == VehicleConfigurationSource::INPUT_HOTT_SUMD ||
settings->getInputType() == VehicleConfigurationSource::INPUT_EXBUS ||
settings->getInputType() == VehicleConfigurationSource::INPUT_SRXL) {
settings->getInputType() == VehicleConfigurationSource::INPUT_EXBUS) {
// Disable GPS+I2C Mag
setItemDisabled(VehicleConfigurationSource::GPS_UBX_FLEXI_I2CMAG, true);
if (getSelectedItem()->id() == VehicleConfigurationSource::GPS_UBX_FLEXI_I2CMAG) {
@ -67,12 +67,6 @@ bool GpsPage::validatePage(SelectionItem *selectedItem)
void GpsPage::setupSelection(Selection *selection)
{
QString i2cPortName = "FlexiPort.";
if (getWizard()->getControllerType() == SetupWizard::CONTROLLER_SPARKY2) {
i2cPortName = tr("I2C Port (under).");
}
selection->setTitle(tr("GPS Selection"));
selection->setText(tr("Please select the type of GPS you wish to use. As well as OpenPilot hardware, "
"3rd party GPSs are supported also, although please note that performance could "
@ -99,7 +93,7 @@ void GpsPage::setupSelection(Selection *selection)
selection->addItem(tr("U-Blox Based + Magnetometer"),
tr("Select this option for the generic U-Blox chipset based GPS + I2C Magnetometer.\n\n"
"GPS is connected to MainPort and two wires I2C to ") + i2cPortName,
"GPS is connected to MainPort and two wires I2C to FlexiPort."),
"generic-ublox-mag",
SetupWizard::GPS_UBX_FLEXI_I2CMAG);

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 4.6 MiB

View File

@ -469,11 +469,9 @@ QString SetupWizard::getSummaryText()
summary.append(tr("Software Estimated"));
break;
case AIRSPEED_EAGLETREE:
//(getControllerType() == CONTROLLER_SPARKY2) ? summary.append(tr("EagleTree on I2C-Port")) : summary.append(tr("EagleTree on Flexi-Port"));
summary.append(tr("EagleTree on Flexi-Port"));
break;
case AIRSPEED_MS4525:
//(getControllerType() == CONTROLLER_SPARKY2) ? summary.append(tr("MS4525 based on I2C-Port")) : summary.append(tr("MS4525 based on Flexi-Port"));
summary.append(tr("MS4525 based on Flexi-Port"));
break;
default: