forked from len0rd/rockbox
utils/regtools: make qeditor able to poke directly at a hwstub device
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
This commit is contained in:
parent
81dfed27cf
commit
0e0c610df0
6 changed files with 490 additions and 45 deletions
|
|
@ -6,25 +6,24 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
Backend *backend = new Backend;
|
||||
Backend backend;;
|
||||
QDir dir(QCoreApplication::applicationDirPath());
|
||||
dir.cdUp();
|
||||
dir.cd("desc");
|
||||
dir.setFilter(QDir::Files);
|
||||
printf("%s\n", dir.absolutePath().toStdString().c_str());
|
||||
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());
|
||||
backend.LoadSocDesc(fileInfo.absoluteFilePath());
|
||||
}
|
||||
|
||||
QCoreApplication::setOrganizationName("Rockbox");
|
||||
QCoreApplication::setApplicationName("Register Editor");
|
||||
QCoreApplication::setOrganizationDomain("rockbox.org");
|
||||
MainWindow win(backend);
|
||||
MainWindow win(&backend);
|
||||
win.show();
|
||||
return app.exec();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue