mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-29 19:53:44 -06:00
Firmware updater: rework cancelling
This commit is contained in:
parent
4f4649d046
commit
a43e72f696
10 changed files with 101 additions and 45 deletions
|
|
@ -13,7 +13,7 @@ class AvrDude
|
|||
public:
|
||||
typedef std::shared_ptr<AvrDude> Ptr;
|
||||
typedef std::function<void(const char * /* msg */, unsigned /* size */)> MessageFn;
|
||||
typedef std::function<bool(const char * /* task */, unsigned /* progress */)> ProgressFn;
|
||||
typedef std::function<void(const char * /* task */, unsigned /* progress */)> ProgressFn;
|
||||
typedef std::function<void(int /* exit status */)> CompleteFn;
|
||||
|
||||
AvrDude();
|
||||
|
|
@ -33,8 +33,7 @@ public:
|
|||
AvrDude& on_message(MessageFn fn);
|
||||
|
||||
// Set progress report callback
|
||||
// Progress is reported per each task (reading / writing), progress is reported in percents.
|
||||
// The callback's return value indicates whether to continue flashing (true) or cancel (false).
|
||||
// Progress is reported per each task (reading / writing) in percents.
|
||||
AvrDude& on_progress(ProgressFn fn);
|
||||
|
||||
// Called when avrdude's main function finishes
|
||||
|
|
@ -42,6 +41,8 @@ public:
|
|||
|
||||
int run_sync();
|
||||
Ptr run();
|
||||
|
||||
void cancel();
|
||||
void join();
|
||||
private:
|
||||
struct priv;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue