DeviceWidget::DeviceWidget(QWidget *parent) : QWidget(parent) { myDevice = new Ui_deviceWidget(); myDevice->setupUi(this); // Initialization of the Device icon display myDevice->verticalGroupBox_loaded->setVisible(false); myDevice->groupCustom->setVisible(false); myDevice->confirmCheckBox->setVisible(false); myDevice->gVDevice->setScene(new QGraphicsScene(this)); connect(myDevice->retrieveButton, SIGNAL(clicked()), this, SLOT(downloadFirmware())); connect(myDevice->updateButton, SIGNAL(clicked()), this, SLOT(uploadFirmware())); connect(myDevice->pbLoad, SIGNAL(clicked()), this, SLOT(loadFirmware())); connect(myDevice->confirmCheckBox, SIGNAL(stateChanged(int)), this, SLOT(confirmCB(int))); myDevice->statusIcon->setPixmap(QPixmap(":uploader/images/view-refresh.svg")); myDevice->lblCertified->setText(""); }
void TellStick::enterBootloader() { FT_Purge(d->ftHandle, FT_PURGE_RX | FT_PURGE_TX); FT_STATUS ftStatus = FT_SetBitMode(d->ftHandle, 0xff, 0x20); for (int i = 0; i < 100; ++i) { msleep(1); QApplication::processEvents(); } ftStatus = FT_SetBitMode(d->ftHandle, 0xf0, 0x20); char buf = 0; while(1) { //TODO: Make it possible to bail! QApplication::processEvents(); buf = getCh(); if (buf == 'g') { break; } } send('r'); setUpgradeStep(3); QTimer::singleShot(1000, this, SLOT(downloadFirmware())); }
bool usb_downloadfw(CCyUSBDevice* USBDevice,char* filename){ return downloadFirmware(USBDevice, filename); }