summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Halbert <halbert@adafruit.com>2020-07-21 13:29:10 -0400
committerGitHub <noreply@github.com>2020-07-21 13:29:10 -0400
commit7f27fcd63af7253f4c0fc11f51d0635c1644c325 (patch)
tree98fcf9b823681109fd558a9809e79183c8ec3649
parent12edb57aace86422c6e0165c5281efb72b5ee3b3 (diff)
parente5f7adcf5d1257cefd33831d541b829ca8267aca (diff)
Merge pull request #3149 from DavePutz/issue2949
Issue#2949 Put in a check to prevent USB starvation by long calculations
-rw-r--r--py/mpz.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/mpz.c b/py/mpz.c
index 7800cdcc4..41b46f92f 100644
--- a/py/mpz.c
+++ b/py/mpz.c
@@ -444,6 +444,10 @@ STATIC size_t mpn_mul(mpz_dig_t *idig, mpz_dig_t *jdig, size_t jlen, mpz_dig_t *
}
ilen = id - oidig;
+ // check to prevent usb starvation
+ #ifdef RUN_BACKGROUND_TASKS
+ RUN_BACKGROUND_TASKS;
+ #endif
}
return ilen;