Firmware updater: rework cancelling

This commit is contained in:
Vojtech Kral
2018-05-21 15:24:24 +02:00
parent 4f4649d046
commit a43e72f696
10 changed files with 101 additions and 45 deletions

View File

@@ -21,7 +21,6 @@
#ifndef avrdude_h
#define avrdude_h
#include <stdbool.h>
extern char * progname; /* name of program, for messages */
extern char progbuf[]; /* spaces same length as progname */
@@ -36,9 +35,12 @@ int avrdude_message(const int msglvl, const char *format, ...);
// Progress reporting callback
// `progress` is in range 0 ~ 100 percent
typedef bool (*avrdude_progress_handler_t)(const char *task, unsigned progress, void *user_p);
typedef void (*avrdude_progress_handler_t)(const char *task, unsigned progress, void *user_p);
void avrdude_progress_handler_set(avrdude_progress_handler_t newhandler, void *user_p);
bool avrdude_progress_external(const char *task, unsigned progress);
void avrdude_progress_external(const char *task, unsigned progress);
// Cancellation
void avrdude_cancel();
#define MSG_INFO (0) /* no -v option, can be supressed with -qq */
#define MSG_NOTICE (1) /* displayed with -v */