mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
OP-21/Flight Bootloader - Test App, fixes wrong file being uploaded to HW. It was the PC app itself that was being uploaded. Is anyone feeling an ugly monkey pointing his finger??
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1421 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
c84746b701
commit
c754ef865e
@ -7,10 +7,10 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
QString filename;
|
||||
if(argc < 1)
|
||||
filename = QString("C:\\OpenPilot.bin");
|
||||
if(argc < 2)
|
||||
filename = QString("C:/OpenPilot.bin");
|
||||
else
|
||||
filename = QString(argv[0]);
|
||||
filename = QString(argv[1]);
|
||||
|
||||
OP_DFU dfu;
|
||||
// dfu.enterDFU(1);
|
||||
|
@ -236,7 +236,7 @@ void OP_DFU::EndOperation()
|
||||
hidHandle.receive(0,buf,BUF_LEN,5000);
|
||||
qDebug() << result << " bytes sent";
|
||||
}
|
||||
void OP_DFU::UploadFirmware(QString sfile)
|
||||
void OP_DFU::UploadFirmware(const QString &sfile)
|
||||
{
|
||||
enterDFU(1);
|
||||
QFile file(sfile);
|
||||
@ -247,6 +247,7 @@ void OP_DFU::UploadFirmware(QString sfile)
|
||||
return;
|
||||
}
|
||||
QByteArray arr=file.readAll();
|
||||
qDebug()<<"Bytes Loaded="<<arr.length();
|
||||
if(arr.length()%4!=0)
|
||||
{
|
||||
int pad=arr.length()/4;
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
void StartUpload(qint32 numberOfBytes, TransferTypes type);
|
||||
void UploadData(qint32 numberOfPackets,QByteArray data);
|
||||
void UploadDescription(int devNumber, QString description);
|
||||
void UploadFirmware(QString sfile);
|
||||
void UploadFirmware(const QString &sfile);
|
||||
int StatusRequest();
|
||||
void EndOperation();
|
||||
QString DownloadDescription(int devNumber,int numberOfChars);
|
||||
|
Loading…
x
Reference in New Issue
Block a user