Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
dffa38fd
Commit
dffa38fd
authored
May 11, 2019
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
cf28b0be
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
FirmwareUpgradeController.cc
src/VehicleSetup/FirmwareUpgradeController.cc
+17
-5
FirmwareUpgradeController.h
src/VehicleSetup/FirmwareUpgradeController.h
+1
-0
No files found.
src/VehicleSetup/FirmwareUpgradeController.cc
View file @
dffa38fd
...
...
@@ -643,7 +643,7 @@ void FirmwareUpgradeController::setSelectedFirmwareBuildType(FirmwareBuildType_t
void
FirmwareUpgradeController
::
_buildAPMFirmwareNames
(
void
)
{
q
Debug
(
)
<<
"_buildAPMFirmwareNames"
;
q
CDebug
(
FirmwareUpgradeLog
)
<<
"_buildAPMFirmwareNames"
;
bool
chibios
=
_apmChibiOSSetting
->
rawValue
().
toInt
()
==
0
;
FirmwareVehicleType_t
vehicleType
=
static_cast
<
FirmwareVehicleType_t
>
(
_apmVehicleTypeSetting
->
rawValue
().
toInt
());
...
...
@@ -659,23 +659,33 @@ void FirmwareUpgradeController::_buildAPMFirmwareNames(void)
if
(
firmwareInfo
.
firmwareBuildType
==
_selectedFirmwareBuildType
&&
firmwareInfo
.
chibios
==
chibios
&&
firmwareInfo
.
vehicleType
==
vehicleType
)
{
if
(
bootloaderMatch
)
{
if
(
firmwareInfo
.
rgBootloaderPortString
.
contains
(
_foundBoardInfo
.
description
()))
{
q
Debug
()
<<
"Booa
tloader match:"
<<
firmwareInfo
.
friendlyName
<<
_foundBoardInfo
.
description
()
<<
firmwareInfo
.
rgBootloaderPortString
<<
firmwareInfo
.
url
<<
firmwareInfo
.
vehicleType
;
q
CDebug
(
FirmwareUpgradeLog
)
<<
"Boo
tloader match:"
<<
firmwareInfo
.
friendlyName
<<
_foundBoardInfo
.
description
()
<<
firmwareInfo
.
rgBootloaderPortString
<<
firmwareInfo
.
url
<<
firmwareInfo
.
vehicleType
;
match
=
true
;
}
}
else
{
if
(
firmwareInfo
.
rgVID
.
contains
(
_foundBoardInfo
.
vendorIdentifier
())
&&
firmwareInfo
.
rgPID
.
contains
(
_foundBoardInfo
.
productIdentifier
()))
{
q
Debug
(
)
<<
"Fallback match:"
<<
firmwareInfo
.
friendlyName
<<
_foundBoardInfo
.
vendorIdentifier
()
<<
_foundBoardInfo
.
productIdentifier
()
<<
_bootloaderBoardID
<<
firmwareInfo
.
url
<<
firmwareInfo
.
vehicleType
;
q
CDebug
(
FirmwareUpgradeLog
)
<<
"Fallback match:"
<<
firmwareInfo
.
friendlyName
<<
_foundBoardInfo
.
vendorIdentifier
()
<<
_foundBoardInfo
.
productIdentifier
()
<<
_bootloaderBoardID
<<
firmwareInfo
.
url
<<
firmwareInfo
.
vehicleType
;
match
=
true
;
}
}
}
// Do a final filter on fmuv2/fmuv3
if
(
match
&&
_bootloaderBoardID
==
Bootloader
::
boardIDPX4FMUV3
)
{
match
=
!
firmwareInfo
.
fmuv2
;
}
if
(
match
)
{
_apmFirmwareNames
.
append
(
firmwareInfo
.
friendlyName
);
_apmFirmwareUrls
.
append
(
firmwareInfo
.
url
);
}
}
if
(
_apmFirmwareNames
.
count
()
>
1
)
{
_apmFirmwareNames
.
prepend
(
tr
(
"Choose board type"
));
_apmFirmwareUrls
.
prepend
(
QString
());
}
emit
apmFirmwareNamesChanged
();
}
...
...
@@ -829,9 +839,10 @@ void FirmwareUpgradeController::_ardupilotManifestDownloadFinished(QString remot
FirmwareVehicleType_t
firmwareVehicleType
=
_manifestMavTypeToFirmwareVehicleType
(
firmwareJson
[
_manifestMavTypeJsonKey
].
toString
());
FirmwareBuildType_t
firmwareBuildType
=
_manifestMavFirmwareVersionTypeToFirmwareBuildType
(
firmwareJson
[
_manifestMavFirmwareVersionTypeJsonKey
].
toString
());
QString
format
=
firmwareJson
[
_manifestFormatJsonKey
].
toString
();
QString
platform
=
firmwareJson
[
_manifestPlatformKey
].
toString
();
if
(
firmwareVehicleType
!=
DefaultVehicleFirmware
&&
firmwareBuildType
!=
CustomFirmware
&&
(
format
==
QStringLiteral
(
"apj"
)
||
format
==
QStringLiteral
(
"px4"
)))
{
if
(
firmwareJson
[
_manifestPlatformKey
].
toString
()
.
contains
(
"-heli"
)
&&
firmwareVehicleType
!=
HeliFirmware
)
{
if
(
platform
.
contains
(
"-heli"
)
&&
firmwareVehicleType
!=
HeliFirmware
)
{
continue
;
}
...
...
@@ -844,6 +855,7 @@ void FirmwareUpgradeController::_ardupilotManifestDownloadFinished(QString remot
firmwareInfo
.
url
=
firmwareJson
[
_manifestUrlJsonKey
].
toString
();
firmwareInfo
.
version
=
firmwareJson
[
_manifestMavFirmwareVersionJsonKey
].
toString
();
firmwareInfo
.
chibios
=
format
==
QStringLiteral
(
"apj"
);
firmwareInfo
.
fmuv2
=
platform
.
contains
(
QStringLiteral
(
"fmuv2"
));
QJsonArray
bootloaderArray
=
firmwareJson
[
_manifestBootloaderStrJsonKey
].
toArray
();
for
(
int
j
=
0
;
j
<
bootloaderArray
.
count
();
j
++
)
{
...
...
@@ -862,7 +874,7 @@ void FirmwareUpgradeController::_ardupilotManifestDownloadFinished(QString remot
}
QString
brandName
=
firmwareJson
[
_manifestBrandNameKey
].
toString
();
firmwareInfo
.
friendlyName
=
QStringLiteral
(
"%1 - %2"
).
arg
(
brandName
.
isEmpty
()
?
firmwareJson
[
_manifestPlatformKey
].
toString
()
:
brandName
).
arg
(
firmwareInfo
.
version
);
firmwareInfo
.
friendlyName
=
QStringLiteral
(
"%1 - %2"
).
arg
(
brandName
.
isEmpty
()
?
platform
:
brandName
).
arg
(
firmwareInfo
.
version
);
}
}
...
...
src/VehicleSetup/FirmwareUpgradeController.h
View file @
dffa38fd
...
...
@@ -290,6 +290,7 @@ private:
QList
<
int
>
rgPID
;
QString
friendlyName
;
bool
chibios
;
bool
fmuv2
;
}
ManifestFirmwareInfo_t
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment