Explorar el Código

Erste Version mit vollständigem Plugin. Issue #1 bereinigt.

Rind hace 5 años
padre
commit
bb92a307bd

+ 2 - 0
qmlplugin/Demo/main.qml

@@ -339,6 +339,8 @@ Window {
             {
                 idExecOut.text = "";
 	            idTivaFlash.getMatSer(statNr);
+//	            idTivaFlash.getFileImgInfo();
+//	            idTivaFlash.reviveBootloader(statNr);
 			}
         }
     }

+ 37 - 0
qmlplugin/libgfativaflashplugin/gfativaflash.cpp

@@ -471,6 +471,25 @@ bool TivaFlash::getTargetImgInfo(int nSlvID, int nMbID)
 	return true;
 }
 
+bool TivaFlash::getFileImgInfo(void)
+{
+	if(m_bExecuting)
+		return false;
+	m_curSlvID = 0;
+
+	setImgSizeFile(0);
+	setImgCRC32File(0.0);
+	setImgMaterialFile("");
+	setImgBuildFile("");
+
+	QStringList args;
+	args << "--show-file-img-info";
+	args << "--plugin-mode";
+	args << QString::fromStdString(m_imgFile);
+	m_qProcess.start(QString::fromStdString(m_tivaFlashUtilPath), args, QIODevice::ReadOnly);
+	return true;
+}
+
 bool TivaFlash::pingTarget(int nSlvID, int nMbID)
 {
 	if(m_bExecuting)
@@ -569,6 +588,24 @@ bool TivaFlash::uploadImgFile(int nSlvID, int nMbID)
 	return true;
 }
 
+bool TivaFlash::reviveBootloader(int nSlvID)
+{
+	if(m_bExecuting)
+		return false;
+	if(!_IS_VALID_SLV_ID(nSlvID))
+		return false;
+	m_curSlvID = nSlvID;
+
+	QStringList args;
+	args << "--revive-boot";
+	args << QString::asprintf("--itf-name=%s", m_itfName.c_str());
+	getSlavIDs(nSlvID, 0, args);
+	getForceAllParities(args);
+	args << "--plugin-mode";
+	m_qProcess.start(QString::fromStdString(m_tivaFlashUtilPath), args, QIODevice::ReadOnly);
+	return true;
+}
+
 bool TivaFlash::clearImgInfo(int nSlvID)
 {
 	if(m_bExecuting)

+ 2 - 0
qmlplugin/libgfativaflashplugin/gfativaflash.h

@@ -156,11 +156,13 @@ public:
 public:
 	Q_INVOKABLE bool getMatSer(int nSlvID, int nMbID = 0);
 	Q_INVOKABLE bool getTargetImgInfo(int nSlvID, int nMbID = 0);
+	Q_INVOKABLE bool getFileImgInfo(void);
 	Q_INVOKABLE bool pingTarget(int nSlvID, int nMbID = 0);
 	Q_INVOKABLE bool startBootloader(int nSlvID, int nMbID = 0);
 	Q_INVOKABLE bool resetBootloader(int nSlvID, int nMbID = 0);
 	Q_INVOKABLE bool validateImgFile(int nSlvID, int nMbID = 0);
 	Q_INVOKABLE bool uploadImgFile(int nSlvID, int nMbID = 0);
+	Q_INVOKABLE bool reviveBootloader(int nSlvID);
 	Q_INVOKABLE bool clearImgInfo(int nSlvID);
 
 signals: