0e0c610df0
This commit add the very handy feature of being able to read registers directly from a device using hwstub. This is mostly trivial using the hwstub library and the biggest change here is actually: - being able to read registers by name and/or addresses - being able to enumerate devives The UI code currently doesn't handle hotplug but the backend does so it should be trivial to add in the future. It also opens up the possibility the write registers from hwstub or save the register values to a file. Since it relies on both hwstub and libusb, a switch has been introduced in qmake to disable it (use -config nohwstub). Change-Id: I5d7d7a2a7c97ecd7407227357c8553c2773ea6cc
29 lines
840 B
C++
29 lines
840 B
C++
#include <QApplication>
|
|
#include <QDir>
|
|
#include "mainwindow.h"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QApplication app(argc, argv);
|
|
|
|
Backend backend;;
|
|
QDir dir(QCoreApplication::applicationDirPath());
|
|
dir.cdUp();
|
|
dir.cd("desc");
|
|
dir.setFilter(QDir::Files);
|
|
QFileInfoList list = dir.entryInfoList();
|
|
for(int i = 0; i < list.size(); i++)
|
|
{
|
|
QFileInfo fileInfo = list.at(i);
|
|
if(fileInfo.fileName().right(4) != ".xml" || fileInfo.fileName().left(5) != "regs-")
|
|
continue;
|
|
backend.LoadSocDesc(fileInfo.absoluteFilePath());
|
|
}
|
|
|
|
QCoreApplication::setOrganizationName("Rockbox");
|
|
QCoreApplication::setApplicationName("Register Editor");
|
|
QCoreApplication::setOrganizationDomain("rockbox.org");
|
|
MainWindow win(&backend);
|
|
win.show();
|
|
return app.exec();
|
|
}
|