mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-24 17:21:11 -06:00
Firmware updater: rework cancelling
This commit is contained in:
parent
4f4649d046
commit
a43e72f696
10 changed files with 101 additions and 45 deletions
|
|
@ -21,10 +21,10 @@ static void avrdude_message_handler_closure(const char *msg, unsigned size, void
|
|||
}
|
||||
|
||||
// Used by our custom code in avrdude to report progress in the GUI
|
||||
static bool avrdude_progress_handler_closure(const char *task, unsigned progress, void *user_p)
|
||||
static void avrdude_progress_handler_closure(const char *task, unsigned progress, void *user_p)
|
||||
{
|
||||
auto *progress_fn = reinterpret_cast<AvrDude::ProgressFn*>(user_p);
|
||||
return (*progress_fn)(task, progress);
|
||||
(*progress_fn)(task, progress);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -134,6 +134,11 @@ AvrDude::Ptr AvrDude::run()
|
|||
return self;
|
||||
}
|
||||
|
||||
void AvrDude::cancel()
|
||||
{
|
||||
::avrdude_cancel();
|
||||
}
|
||||
|
||||
void AvrDude::join()
|
||||
{
|
||||
if (p && p->avrdude_thread.joinable()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue