Revert to micropython_port_should_interrupt

This commit is contained in:
Romain Goyet
2018-11-14 16:57:16 +01:00
parent 24630011b1
commit d7a13ba8fd
4 changed files with 8 additions and 10 deletions

View File

@@ -4,15 +4,13 @@ extern "C" {
#include "mphalport.h"
}
bool micropython_port_should_interrupt(bool force) {
bool micropython_port_should_interrupt() {
static int c = 0;
if(!force) {
c++;
if (c%20000 != 0) {
return false;
}
c = 0;
c++;
if (c%20000 != 0) {
return false;
}
c = 0;
Ion::Keyboard::State scan = Ion::Keyboard::scan();
if (scan.keyDown((Ion::Keyboard::Key)mp_interrupt_char)) {
mp_keyboard_interrupt();