1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-21/Bootloader - fixed compile issue. Added user space reset function.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2125 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
zedamota 2010-11-14 20:30:30 +00:00 committed by zedamota
parent ecb5c719d2
commit fb21b141ba
3 changed files with 16 additions and 1 deletions

View File

@ -25,7 +25,20 @@ OP_DFU::OP_DFU(bool _debug): debug(_debug)
}
if(debug)
qDebug() << numDevices << " device(s) opened";
sendReset();
}
void OP_DFU::sendReset(void)
{
char b[64]={0x02,0x24,0x3C,0x20,0x17,0x00,0x30,0x76,0x1F,0x40,0x62,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0x40,0x2E,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
hidHandle.send(0,b,64,1000);
delay::msleep(600);
char bb[64]={0x02,0x24,0x3C,0x20,0x17,0x00,0x30,0x76,0x1F,0x40,0xB9,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0xE8,0x30,0x00,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
hidHandle.send(0,bb,64,1000);
delay::msleep(600);
char bbb[64]={0x02,0x24,0x3C,0x20,0x17,0x00,0x30,0x76,0x1F,0x40,0x10,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF9,0x61,0x34,0x00,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
hidHandle.send(0,bbb,64,1000);
}
bool OP_DFU::SaveByteArrayToFile(QString const & sfile, const QByteArray &array)
{
QFile file(sfile);

View File

@ -115,6 +115,7 @@ public:
void CopyWords(char * source, char* destination, int count);
// QByteArray DownloadData(int devNumber,int numberOfPackets);
OP_DFU(bool debug);
void sendReset(void);
bool findDevices();
QList<device> devices;
int numberOfDevices;

View File

@ -13,11 +13,12 @@ CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
DEFINES += RAWHID_LIBRARY
SOURCES += main.cpp \
op_dfu.cpp \
delay.cpp
HEADERS += ../../plugins/rawhid/pjrc_rawhid.h \
../../plugins/rawhid/rawhid_global.h \
op_dfu.h \
delay.h