From f052bd9088cfb86f84ebd7bdfb29c6c22ebf04b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Fri, 9 Nov 2018 09:47:05 +0100 Subject: [PATCH] [python/port] Clean some code --- python/port/helpers.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/port/helpers.cpp b/python/port/helpers.cpp index ac0114b02..0bd294ed6 100644 --- a/python/port/helpers.cpp +++ b/python/port/helpers.cpp @@ -12,11 +12,11 @@ void micropython_port_vm_hook_loop() { /* Doing too many things here slows down Python execution quite a lot. So we * only do things once in a while and return as soon as possible otherwise. */ static int c = 0; - c++; - if (c % 20000 != 0) { + + c = (c + 1) % 20000; + if (c != 0) { return; } - c = 0; /* Check if the user asked for an interruption from the keyboard */ Ion::Keyboard::State scan = Ion::Keyboard::scan();