forked from qt-creator/qt-creator
McuSupport: Qul v1.2 adjustments
- Bump supported version from 1.1 to 1.2 - Look in Qul_DIR/kits for boards json files (UL-2390) - Remove "pragma main;" from app template main qml (UL-1708) - Add a main.cpp for BareMetal and FreeRTOS each (QTCREATORBUG-24063) - Removed ambiguous armgcc download link (QTCREATORBUG-24052) Task-number: UL-1708 Task-number: UL-2390 Task-number: QTCREATORBUG-24063 Task-number: QTCREATORBUG-24052 Task-number: QTCREATORBUG-24079 Change-Id: Ieb3d0c22b9099b12f91096b5a90c6e84698be788 Reviewed-by: Christian Kamm <mail@ckamm.de>
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
<file>wizards/icon@2x.png</file>
|
||||
<file>wizards/application/CMakeLists.txt</file>
|
||||
<file>wizards/application/project.qmlproject.tpl</file>
|
||||
<file>wizards/application/BareMetal/main.cpp.tpl</file>
|
||||
<file>wizards/application/FreeRTOS/main.cpp.tpl</file>
|
||||
<file>wizards/application/main.qml.tpl</file>
|
||||
<file>wizards/application/wizard.json</file>
|
||||
</qresource>
|
||||
|
@@ -61,7 +61,7 @@
|
||||
namespace McuSupport {
|
||||
namespace Internal {
|
||||
|
||||
static const int KIT_VERSION = 4; // Bumps up whenever details in Kit creation change
|
||||
static const int KIT_VERSION = 5; // Bumps up whenever details in Kit creation change
|
||||
|
||||
static QString packagePathFromSettings(const QString &settingsKey, const QString &defaultPath = {})
|
||||
{
|
||||
@@ -441,7 +441,7 @@ void McuSupportOptions::deletePackagesAndTargets()
|
||||
|
||||
const QVersionNumber &McuSupportOptions::supportedQulVersion()
|
||||
{
|
||||
static const QVersionNumber v({1, 1});
|
||||
static const QVersionNumber v({1, 2});
|
||||
return v;
|
||||
}
|
||||
|
||||
|
@@ -99,8 +99,6 @@ static McuToolChainPackage *createArmGccPackage()
|
||||
Utils::HostOsInfo::withExecutableSuffix("bin/arm-none-eabi-g++"),
|
||||
"GNUArmEmbeddedToolchain",
|
||||
McuToolChainPackage::TypeArmGcc);
|
||||
result->setDownloadUrl(
|
||||
"https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads");
|
||||
result->setEnvironmentVariableName(envVar);
|
||||
return result;
|
||||
}
|
||||
@@ -294,13 +292,8 @@ static QVector<McuTarget *> targetsFromDescriptions(const QList<McuTargetDescrip
|
||||
|
||||
static QFileInfoList targetDescriptionFiles(const Utils::FilePath &dir)
|
||||
{
|
||||
// Workaround for UL-2390: Instead of "./kits/", walk through "./lib/cmake/Qul/boards/"
|
||||
QFileInfoList result;
|
||||
QDirIterator it(dir.toString() + "/lib/cmake/Qul/boards/", {QLatin1String("*.json")},
|
||||
QDir::Files, QDirIterator::Subdirectories);
|
||||
while (it.hasNext())
|
||||
result.append(it.next());
|
||||
return result;
|
||||
const QDir kitsDir(dir.toString() + "/kits/", "*.json");
|
||||
return kitsDir.entryInfoList();
|
||||
}
|
||||
|
||||
static QString freeRTOSEnvVarForPlatform(const QString &platform)
|
||||
|
@@ -0,0 +1,14 @@
|
||||
#include "%{ProjectName}.h"
|
||||
|
||||
#include <qul/application.h>
|
||||
#include <qul/qul.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
Qul::initPlatform();
|
||||
Qul::Application app;
|
||||
static %{ProjectName} item;
|
||||
app.setRootItem(&item);
|
||||
app.exec();
|
||||
return 0;
|
||||
}
|
@@ -4,7 +4,7 @@ project(%{ProjectName} VERSION 0.0.1 LANGUAGES C CXX ASM)
|
||||
|
||||
find_package(Qul)
|
||||
|
||||
add_executable(%{ProjectName})
|
||||
add_executable(%{ProjectName} ${OS}/main.cpp)
|
||||
qul_target_qml_sources(%{ProjectName} %{MainQmlFile})
|
||||
|
||||
target_link_libraries(%{ProjectName} Qul::QuickUltralite)
|
||||
|
@@ -0,0 +1,38 @@
|
||||
#include "%{ProjectName}.h"
|
||||
|
||||
#include <qul/application.h>
|
||||
#include <qul/qul.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
|
||||
#ifndef QUL_STACK_SIZE
|
||||
#error QUL_STACK_SIZE must be defined.
|
||||
#endif
|
||||
|
||||
static void Qul_Thread(void *argument);
|
||||
|
||||
int main()
|
||||
{
|
||||
Qul::initPlatform();
|
||||
|
||||
if (xTaskCreate(Qul_Thread, "QulExec", QUL_STACK_SIZE, 0, 4, 0) != pdPASS) {
|
||||
std::printf("Task creation failed!.\\r\\n");
|
||||
configASSERT(false);
|
||||
}
|
||||
|
||||
vTaskStartScheduler();
|
||||
|
||||
// Should not reach this point
|
||||
configASSERT(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void Qul_Thread(void *argument)
|
||||
{
|
||||
Qul::Application app;
|
||||
static %{ProjectName} item;
|
||||
app.setRootItem(&item);
|
||||
app.exec();
|
||||
}
|
@@ -1,4 +1,3 @@
|
||||
pragma main;
|
||||
import QtQuick 2.0
|
||||
|
||||
Rectangle {
|
||||
|
@@ -52,6 +52,16 @@
|
||||
"target": "%{ProjectDirectory}/%{ProjectName}.qmlproject",
|
||||
"openInEditor": false
|
||||
},
|
||||
{
|
||||
"source": "BareMetal/main.cpp.tpl",
|
||||
"target": "%{ProjectDirectory}/BareMetal/main.cpp",
|
||||
"openInEditor": false
|
||||
},
|
||||
{
|
||||
"source": "FreeRTOS/main.cpp.tpl",
|
||||
"target": "%{ProjectDirectory}/FreeRTOS/main.cpp",
|
||||
"openInEditor": false
|
||||
},
|
||||
{
|
||||
"source": "main.qml.tpl",
|
||||
"target": "%{ProjectDirectory}/%{MainQmlFile}",
|
||||
|
Reference in New Issue
Block a user