-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArduinoUploader.h
44 lines (33 loc) · 881 Bytes
/
ArduinoUploader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef ARDUINOUPLOADER_H
#define ARDUINOUPLOADER_H
#include <QObject>
#include <QProcess>
#include <QTimer>
class ArduinoUploader : public QObject
{
Q_OBJECT
public:
explicit ArduinoUploader(const QString &hexFilePath,
const QString &comPort,
QObject *parent = 0);
signals:
void complete();
void error(const QString &error);
public slots:
void upload();
private slots:
void checkPort();
void avrDudeError(QProcess::ProcessError error);
void avrDudeProcessFinished(int exitCode);
private:
void findLeonardoPort();
QStringList listPorts() const;
void runAvrDude();
QString hexFilePath_;
QString comPort_;
QTimer *portWaitTimer_;
QStringList portsBefore_;
int portWaitTimeElapsedMs_;
QProcess *avrDudeProcess_;
};
#endif // ARDUINOUPLOADER_H