forked from qt-creator/qt-creator
McuSupport: support for Renesas Flash Programmer
Task-number: UL-5082 Change-Id: I1eb4583fa2635adfc302f878301152c2358de446 Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -301,9 +301,13 @@ static McuPackage *createCypressProgrammerPackage()
|
|||||||
if (qEnvironmentVariableIsSet(envVar)) {
|
if (qEnvironmentVariableIsSet(envVar)) {
|
||||||
defaultPath = FilePath::fromUserInput(qEnvironmentVariable(envVar));
|
defaultPath = FilePath::fromUserInput(qEnvironmentVariable(envVar));
|
||||||
} else if (HostOsInfo::isWindowsHost()) {
|
} else if (HostOsInfo::isWindowsHost()) {
|
||||||
const FilePath candidate = findInProgramFiles("Cypress/Cypress Auto Flash Utility 1.0");
|
const FilePath candidate = findInProgramFiles("Cypress");
|
||||||
if (candidate.exists())
|
if (candidate.exists()) {
|
||||||
defaultPath = candidate;
|
// "Cypress Auto Flash Utility 1.0"
|
||||||
|
const auto subDirs = candidate.dirEntries({"Cypress Auto Flash Utility*"}, QDir::Dirs, QDir::Unsorted);
|
||||||
|
if (!subDirs.empty())
|
||||||
|
defaultPath = subDirs.first();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto result = new McuPackage(
|
auto result = new McuPackage(
|
||||||
@@ -315,6 +319,32 @@ static McuPackage *createCypressProgrammerPackage()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static McuPackage *createRenesasProgrammerPackage()
|
||||||
|
{
|
||||||
|
const char envVar[] = "RenesasFlashProgrammer_PATH";
|
||||||
|
|
||||||
|
FilePath defaultPath;
|
||||||
|
if (qEnvironmentVariableIsSet(envVar)) {
|
||||||
|
defaultPath = FilePath::fromUserInput(qEnvironmentVariable(envVar));
|
||||||
|
} else if (HostOsInfo::isWindowsHost()) {
|
||||||
|
const FilePath candidate = findInProgramFiles("Renesas Electronics/Programming Tools");
|
||||||
|
if (candidate.exists()) {
|
||||||
|
// "Renesas Flash Programmer V3.09"
|
||||||
|
const auto subDirs = candidate.dirEntries({"Renesas Flash Programmer*"}, QDir::Dirs, QDir::Unsorted);
|
||||||
|
if (!subDirs.empty())
|
||||||
|
defaultPath = subDirs.first();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto result = new McuPackage(
|
||||||
|
"Renesas Flash Programmer",
|
||||||
|
defaultPath,
|
||||||
|
Utils::HostOsInfo::withExecutableSuffix("rfp-cli"),
|
||||||
|
"RenesasFlashProgrammer");
|
||||||
|
result->setEnvironmentVariableName(envVar);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
struct McuTargetDescription
|
struct McuTargetDescription
|
||||||
{
|
{
|
||||||
enum class TargetType {
|
enum class TargetType {
|
||||||
@@ -603,6 +633,7 @@ static QVector<McuTarget *> targetsFromDescriptions(const QList<McuTargetDescrip
|
|||||||
{{"ST"}, createStm32CubeProgrammerPackage()},
|
{{"ST"}, createStm32CubeProgrammerPackage()},
|
||||||
{{"NXP"}, createMcuXpressoIdePackage()},
|
{{"NXP"}, createMcuXpressoIdePackage()},
|
||||||
{{"CYPRESS"}, createCypressProgrammerPackage()},
|
{{"CYPRESS"}, createCypressProgrammerPackage()},
|
||||||
|
{{"RENESAS"}, createRenesasProgrammerPackage()},
|
||||||
};
|
};
|
||||||
|
|
||||||
McuTargetFactory targetFactory(tcPkgs, vendorPkgs);
|
McuTargetFactory targetFactory(tcPkgs, vendorPkgs);
|
||||||
|
Reference in New Issue
Block a user