diff options
author | Damien George <damien.p.george@gmail.com> | 2016-04-02 01:32:55 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-04-02 01:34:32 +0300 |
commit | a0cb4eda9a6faef109f64da39e441f2b11afc872 (patch) | |
tree | 93df3cac9c03c86e9ffac7807961defc23b5d5b4 /esp8266 | |
parent | cef073877b0f3c7a3d8bc5ca31a623df1f72287d (diff) | |
download | micropython-a0cb4eda9a6faef109f64da39e441f2b11afc872.tar.gz micropython-a0cb4eda9a6faef109f64da39e441f2b11afc872.zip |
esp8266: Use VM_HOOK to call ets_loop_iter within the VM.
Starting with a divisor of 10, pystone_lowmem gives a score of 256.
Diffstat (limited to 'esp8266')
-rw-r--r-- | esp8266/mpconfigport.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/esp8266/mpconfigport.h b/esp8266/mpconfigport.h index 943b16c8f9..05f2cb913b 100644 --- a/esp8266/mpconfigport.h +++ b/esp8266/mpconfigport.h @@ -69,6 +69,15 @@ #define MICROPY_VFS_FAT (1) #define MICROPY_EVENT_POLL_HOOK {ets_event_poll();} +#define MICROPY_VM_HOOK_COUNT (10) +#define MICROPY_VM_HOOK_INIT static uint vm_hook_divisor = MICROPY_VM_HOOK_COUNT; +#define MICROPY_VM_HOOK_POLL if (--vm_hook_divisor == 0) { \ + vm_hook_divisor = MICROPY_VM_HOOK_COUNT; \ + extern void ets_loop_iter(void); \ + ets_loop_iter(); \ + } +#define MICROPY_VM_HOOK_LOOP MICROPY_VM_HOOK_POLL +#define MICROPY_VM_HOOK_RETURN MICROPY_VM_HOOK_POLL // type definitions for the specific machine |