Files
Upsilon/python/port/interrupt_helper.cpp
Émilie Feral 52f5858ffd [python][apps/code] Enable interrupting python execution
Change-Id: Iadf7038f79f0289ce20d7ded42f8fe70894f0c0a
2017-08-28 13:30:46 +02:00

20 lines
335 B
C++

#include "interrupt_helper.h"
#include <ion.h>
extern "C" {
#include "mphalport.h"
}
void shouldInterrupt() {
static int c = 0;
c++;
if (c%20000 != 0) {
return;
}
c = 0;
Ion::Keyboard::State scan = Ion::Keyboard::scan();
if (scan.keyDown((Ion::Keyboard::Key)mp_interrupt_char)) {
mp_keyboard_interrupt();
}
}