Skip to content

Commit c935601

Browse files
authored
Merge pull request #7678 from FoamyGuy/boundary_fill_background_tasks
do background tasks and handle interrupt during boundary fill
2 parents cc3a626 + f2931de commit c935601

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

ports/unix/mpconfigport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@
194194

195195
extern const struct _mp_print_t mp_stderr_print;
196196

197+
#define RUN_BACKGROUND_TASKS
198+
197199
#if !(defined(MICROPY_GCREGS_SETJMP) || defined(__x86_64__) || defined(__i386__) || defined(__thumb2__) || defined(__thumb__) || defined(__arm__))
198200
// Fall back to setjmp() implementation for discovery of GC pointers in registers.
199201
#define MICROPY_GCREGS_SETJMP (1)

shared-module/bitmaptools/__init__.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* THE SOFTWARE.
2525
*/
2626

27+
#include "shared/runtime/interrupt_char.h"
2728
#include "shared-bindings/bitmaptools/__init__.h"
2829
#include "shared-bindings/displayio/Bitmap.h"
2930
#include "shared-bindings/displayio/Palette.h"
@@ -376,6 +377,10 @@ void common_hal_bitmaptools_boundary_fill(displayio_bitmap_t *destination,
376377
}
377378

378379
mp_obj_list_get(fill_area, &list_length, &fill_points);
380+
RUN_BACKGROUND_TASKS;
381+
if (mp_hal_is_interrupted()) {
382+
return;
383+
}
379384
}
380385

381386
// set dirty the area so displayio will draw

0 commit comments

Comments
 (0)