Browse Source

esp32: Enable native emitter.

pull/5082/head
Damien George 5 years ago
parent
commit
917f027c0b
  1. 10
      ports/esp32/main.c
  2. 3
      ports/esp32/mpconfigport.h

10
ports/esp32/main.c

@ -172,3 +172,13 @@ void nlr_jump_fail(void *val) {
void mbedtls_debug_set_threshold(int threshold) {
(void)threshold;
}
void *esp_native_code_commit(void *buf, size_t len) {
len = (len + 3) & ~3;
uint32_t *p = heap_caps_malloc(len, MALLOC_CAP_EXEC);
if (p == NULL) {
m_malloc_fail(len);
}
memcpy(p, buf, len);
return p;
}

3
ports/esp32/mpconfigport.h

@ -20,6 +20,9 @@
// emitters
#define MICROPY_PERSISTENT_CODE_LOAD (1)
#define MICROPY_EMIT_XTENSAWIN (1)
void *esp_native_code_commit(void*, size_t);
#define MP_PLAT_COMMIT_EXEC(buf, len) esp_native_code_commit(buf, len)
// compiler configuration
#define MICROPY_COMP_MODULE_CONST (1)

Loading…
Cancel
Save