[code] time module

This commit is contained in:
Damien Nicolet
2018-11-03 16:07:01 +01:00
parent 940270e78a
commit 79bfc7f112
14 changed files with 227 additions and 8 deletions

View File

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