Files
Upsilon/python/port/helpers.cpp
2018-04-11 10:27:18 +02:00

20 lines
344 B
C++

#include "helpers.h"
#include <ion.h>
extern "C" {
#include "mphalport.h"
}
void micropython_port_should_interrupt() {
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();
}
}