mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[code/emscripten] On emscripten, fixed waiting after a Python drawing.
The user can now push OK or Back to remove a Python drawing. Change-Id: I293064a9458f8c0c6d0da5351500600fd9e82706
This commit is contained in:
@@ -41,6 +41,10 @@ void MicroPython::ExecutionEnvironment::didModifyFramebuffer() {
|
||||
m_framebufferHasBeenModified = true;
|
||||
}
|
||||
|
||||
void MicroPython::ExecutionEnvironment::didCleanFramebuffer() {
|
||||
m_framebufferHasBeenModified = false;
|
||||
}
|
||||
|
||||
void MicroPython::ExecutionEnvironment::runCode(const char * str) {
|
||||
assert(sCurrentExecutionEnvironment == nullptr);
|
||||
sCurrentExecutionEnvironment = this;
|
||||
@@ -93,6 +97,8 @@ void MicroPython::ExecutionEnvironment::runCode(const char * str) {
|
||||
/* End of mp_obj_print_exception. */
|
||||
}
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#else
|
||||
while (m_framebufferHasBeenModified) {
|
||||
int timeout = 3000;
|
||||
Ion::Events::Event event = Ion::Events::getEvent(&timeout);
|
||||
@@ -101,6 +107,7 @@ void MicroPython::ExecutionEnvironment::runCode(const char * str) {
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
assert(sCurrentExecutionEnvironment == this);
|
||||
sCurrentExecutionEnvironment = nullptr;
|
||||
|
||||
@@ -13,6 +13,8 @@ public:
|
||||
ExecutionEnvironment();
|
||||
static ExecutionEnvironment * currentExecutionEnvironment();
|
||||
void didModifyFramebuffer();
|
||||
bool isFramebufferModified() const { return m_framebufferHasBeenModified; }
|
||||
void didCleanFramebuffer();
|
||||
void runCode(const char * );
|
||||
virtual void printText(const char * text, size_t length) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user