Commit a0cb4eda authored by Damien George's avatar Damien George Committed by Paul Sokolovsky

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.
parent cef07387
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment