![]() |
CHGame 0.3.0
Libraries for the CHGame handheld
|
RAMFUNC(name): put a hot function in SRAM, about three times faster than flash. More...
Macros | |
| #define | CHGAME_RAMFUNC(name) __attribute__((section(".gnu.linkonce.r.chg." #name), noinline)) |
| The library's own SRAM functions (section "chg.<name>"). | |
| #define | CHGAME_APP_RAMFUNC(name) __attribute__((section(".gnu.linkonce.r.app." #name), noinline)) |
| A sketch's SRAM functions (section "app.<name>"); RAMFUNC() is this. | |
| #define | RAMFUNC(name) CHGAME_APP_RAMFUNC(name) |
| Run this function from SRAM. | |
RAMFUNC(name): put a hot function in SRAM, about three times faster than flash.
Flash has 3 wait states and no cache: from flash a per-pixel loop costs ~3 us a pixel on this part; from SRAM about a third of that. Every RAMFUNC costs its size in RAM, so keep it for the inner loops.
| #define CHGAME_RAMFUNC | ( | name | ) | __attribute__((section(".gnu.linkonce.r.chg." #name), noinline)) |
The library's own SRAM functions (section "chg.<name>").
| name | A name unique among the library's RAM functions. |
| #define CHGAME_APP_RAMFUNC | ( | name | ) | __attribute__((section(".gnu.linkonce.r.app." #name), noinline)) |
A sketch's SRAM functions (section "app.<name>"); RAMFUNC() is this.
| name | A name unique within the sketch. |
| #define RAMFUNC | ( | name | ) | CHGAME_APP_RAMFUNC(name) |
Run this function from SRAM.
Put it before the function's declaration.
| name | A name unique within the sketch (any identifier; the function's own name is the usual choice). |