Firmware Flashing Message in Linux

This commit is contained in:
Chris Esposito 2017-12-24 11:13:06 +11:00
parent afa1419480
commit 57eac0f46e
2 changed files with 14 additions and 7 deletions

View File

@ -1121,6 +1121,9 @@ void MainWindow::readSettingsFile(){
ui->controller_iso->internalBuffer375_CH1->frontendGain = calibrate_gain_ch1; ui->controller_iso->internalBuffer375_CH1->frontendGain = calibrate_gain_ch1;
ui->controller_iso->internalBuffer750->frontendGain = calibrate_gain_ch1; ui->controller_iso->internalBuffer750->frontendGain = calibrate_gain_ch1;
ui->controller_iso->internalBuffer375_CH2->frontendGain = calibrate_gain_ch2; ui->controller_iso->internalBuffer375_CH2->frontendGain = calibrate_gain_ch2;
//Prompt user to calibrate if no calibration data found.
} }
void MainWindow::on_actionRecord_triggered(bool checked) void MainWindow::on_actionRecord_triggered(bool checked)

View File

@ -1,5 +1,6 @@
#include "unixusbdriver.h" #include "unixusbdriver.h"
#include "platformspecific.h" #include "platformspecific.h"
#include <QApplication>
unixUsbDriver::unixUsbDriver(QWidget *parent) : genericUsbDriver(parent) unixUsbDriver::unixUsbDriver(QWidget *parent) : genericUsbDriver(parent)
{ {
@ -310,11 +311,14 @@ int unixUsbDriver::flashFirmware(void){
sprintf(fname, "/firmware/labrafirm_%04x_%02x.hex", EXPECTED_FIRMWARE_VERSION, DEFINED_EXPECTED_VARIANT); sprintf(fname, "/firmware/labrafirm_%04x_%02x.hex", EXPECTED_FIRMWARE_VERSION, DEFINED_EXPECTED_VARIANT);
qDebug() << "FLASHING " << fname; qDebug() << "FLASHING " << fname;
signalFirmwareFlash();
QApplication::processEvents();
//Go to bootloader mode
bootloaderJump(); bootloaderJump();
qDebug() << "BA94 closed"; qDebug() << "BA94 closed";
QThread::msleep(2000); //Get location of firmware file
QString dirString = QCoreApplication::applicationDirPath(); QString dirString = QCoreApplication::applicationDirPath();
dirString.append(fname); dirString.append(fname);
QByteArray array = dirString.toLocal8Bit(); QByteArray array = dirString.toLocal8Bit();
@ -333,10 +337,11 @@ int unixUsbDriver::flashFirmware(void){
char command4[256]; char command4[256];
sprintf(command4, "dfu-programmer atxmega32a4u launch"); sprintf(command4, "dfu-programmer atxmega32a4u launch");
//Run stage 1 //Run stage 1, until there's a success
while(exit_code){ while(exit_code){
QThread::msleep(250); QThread::msleep(200);
exit_code = dfuprog_virtual_cmd(command1); exit_code = dfuprog_virtual_cmd(command1);
QApplication::processEvents();
} }
//Run stage 2 //Run stage 2
@ -351,13 +356,12 @@ int unixUsbDriver::flashFirmware(void){
return exit_code+300; return exit_code+300;
} }
QThread::msleep(2000);
//Run stage 4 - double launch to clear the eeprom flag from bootloaderJump. //Run stage 4 - double launch to clear the eeprom flag from bootloaderJump.
exit_code = 1; exit_code = 1;
while(exit_code){ while(exit_code){
QThread::msleep(250); QThread::msleep(200);
exit_code = dfuprog_virtual_cmd(command4); exit_code = dfuprog_virtual_cmd(command4);
QApplication::processEvents();
} }
libusb_release_interface(handle, 0); libusb_release_interface(handle, 0);