1
0
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:
zedamota 2010-08-26 20:19:40 +00:00 committed by zedamota
parent c84746b701
commit c754ef865e
3 changed files with 6 additions and 5 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);