1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

OP-12 HID Bootloader: Patch to make it compile on other platforms than windows and to accept the binary to upload from the command line prompt.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1413 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2010-08-26 06:25:09 +00:00 committed by peabody124
parent 2361af19fb
commit 71de54d0a7
3 changed files with 32 additions and 2 deletions

View File

@ -6,6 +6,12 @@
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QString filename;
if(argc < 1)
filename = QString("C:\\OpenPilot.bin");
else
filename = QString(argv[0]);
OP_DFU dfu;
// dfu.enterDFU(1);
// dfu.StartUpload(4,OP_DFU::Descript);
@ -22,7 +28,7 @@ int main(int argc, char *argv[])
//dfu.UploadDescription(1,"jose manuel");
//QString str=dfu.DownloadDescription(1,12);
// dfu.JumpToApp();
dfu.UploadFirmware("C:/OpenPilot.bin");
dfu.UploadFirmware(filename.toAscii());
//qDebug()<<"Description="<<str;
return a.exec();
}

View File

@ -61,7 +61,7 @@ public:
OP_DFU();
private:
pjrc_rawhid hidHandle;
int setStartBit(int command){return command|0b00100000;}
int setStartBit(int command){return command|0x20;}
};
#endif // OP_DFU_H

View File

@ -24,3 +24,27 @@ win32 {
LIBS += -lhid \
-lsetupapi
}
macx {
SOURCES += ../../plugins/rawhid/pjrc_rawhid_mac.cpp
SDK = /Developer/SDKs/MacOSX10.5.sdk
ARCH = -mmacosx-version-min=10.5 \
-arch \
ppc \
-arch \
i386
LIBS += $(ARCH) \
-Wl,-syslibroot,$(SDK) \
-framework \
IOKit \
-framework \
CoreFoundation
}
linux-g++ {
SOURCES += ../../plugins/rawhid/pjrc_rawhid_unix.cpp
LIBS += -lusb
}
linux-g++-64 {
SOURCES += ../../plugins/rawhid/pjrc_rawhid_unix.cpp
LIBS += -lusb
}