mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 00:00:44 +01:00
[python] Clean the time module
- Export micropython_port_should_interrupt and micropython_port_interruptible_msleep in Emscripten - Make micropython_port_interruptible_msleep available in a helper
This commit is contained in:
@@ -29,3 +29,10 @@ bool micropython_port_should_interrupt() {
|
||||
Ion::Keyboard::Key interruptKey = static_cast<Ion::Keyboard::Key>(mp_interrupt_char);
|
||||
return scan.keyDown(interruptKey);
|
||||
}
|
||||
|
||||
void micropython_port_interruptible_msleep(uint32_t delay) {
|
||||
uint32_t start = Ion::Timing::millis();
|
||||
while (Ion::Timing::millis() - start < delay && !micropython_port_should_interrupt()) {
|
||||
Ion::Timing::msleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user