Skip to content
Snippets Groups Projects
Commit 9514d847 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

esp8266: Add MP_FASTCODE modifier to put a function to iRAM.

It can be used in the following manner:

void MP_FASTCODE(foo)(int arg) { ... }
parent 462748de
No related branches found
No related tags found
No related merge requests found
...@@ -202,7 +202,8 @@ SECTIONS ...@@ -202,7 +202,8 @@ SECTIONS
*(.entry.text) *(.entry.text)
*(.init.literal) *(.init.literal)
*(.init) *(.init)
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) *(.literal .text .literal.* .text.* .iram0.literal .iram0.text .iram0.text.*.literal .iram0.text.*)
*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
*(.fini.literal) *(.fini.literal)
*(.fini) *(.fini)
*(.gnu.version) *(.gnu.version)
......
...@@ -182,4 +182,6 @@ extern const struct _mp_obj_module_t onewire_module; ...@@ -182,4 +182,6 @@ extern const struct _mp_obj_module_t onewire_module;
#define MICROPY_HW_MCU_NAME "ESP8266" #define MICROPY_HW_MCU_NAME "ESP8266"
#define MICROPY_PY_SYS_PLATFORM "esp8266" #define MICROPY_PY_SYS_PLATFORM "esp8266"
#define MP_FASTCODE(n) __attribute__((section(".iram0.text." #n))) n
#define _assert(expr) ((expr) ? (void)0 : __assert_func(__FILE__, __LINE__, __func__, #expr)) #define _assert(expr) ((expr) ? (void)0 : __assert_func(__FILE__, __LINE__, __func__, #expr))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment