aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp')
-rw-r--r--src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp
index 074bce6164..98adbb212a 100644
--- a/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp
+++ b/src/plugins/baremetal/debugservers/uvsc/stlinkuvscserverprovider.cpp
@@ -68,12 +68,6 @@ static QString buildAdapterOptions(const StLinkUvscAdapterOptions &opts)
return s;
}
-static QString buildDllRegistryKey(const DriverSelection &driver)
-{
- const QFileInfo fi(driver.dll);
- return fi.baseName();
-}
-
static QString buildDllRegistryName(const DeviceSelection &device,
const StLinkUvscAdapterOptions &opts)
{
@@ -81,13 +75,11 @@ static QString buildDllRegistryName(const DeviceSelection &device,
return {};
const DeviceSelection::Algorithm algorithm = device.algorithms.at(device.algorithmIndex);
const QFileInfo path(algorithm.path);
- const QString start = algorithm.start.startsWith("0x") ? algorithm.start.mid(2)
- : algorithm.start;
- const QString size = algorithm.size.startsWith("0x") ? algorithm.size.mid(2)
- : algorithm.size;
+ const QString flashStart = UvscServerProvider::adjustFlashAlgorithmProperty(algorithm.flashStart);
+ const QString flashSize = UvscServerProvider::adjustFlashAlgorithmProperty(algorithm.flashSize);
const QString adaptOpts = buildAdapterOptions(opts);
return QStringLiteral(" %6 -FN1 -FF0%1 -FS0%2 -FL0%3 -FP0($$Device:%4$%5)")
- .arg(path.fileName(), start, size, device.name, path.filePath(), adaptOpts);
+ .arg(path.fileName(), flashStart, flashSize, device.name, path.filePath(), adaptOpts);
}
// StLinkUvProjectOptions
@@ -107,7 +99,7 @@ public:
const auto dllRegistry = m_targetOption->appendPropertyGroup("TargetDriverDllRegistry");
const auto setRegEntry = dllRegistry->appendPropertyGroup("SetRegEntry");
setRegEntry->appendProperty("Number", 0);
- const QString key = buildDllRegistryKey(driver);
+ const QString key = UvscServerProvider::buildDllRegistryKey(driver);
setRegEntry->appendProperty("Key", key);
const QString name = buildDllRegistryName(device, provider->m_adapterOpts);
setRegEntry->appendProperty("Name", name);