Removed INLINED (force inline) macro.

Progress towards #57.
This commit is contained in:
Angus Gratton 2015-11-28 18:01:03 +11:00
parent 2d6eeb83ea
commit 812c2fef21
8 changed files with 55 additions and 110 deletions

View file

@ -7,14 +7,15 @@
#include "esp/iomux.h"
#include "common_macros.h"
/* These are non-static versions of the GPIO mapping tables in
iomux.h, so if they need to be linked only one copy is linked for
the entire program.
const static IRAM_DATA uint32_t IOMUX_TO_GPIO[] = { 12, 13, 14, 15, 3, 1, 6, 7, 8, 9, 10, 11, 0, 2, 4, 5 };
const static IRAM_DATA uint32_t GPIO_TO_IOMUX[] = { 12, 5, 13, 4, 14, 15, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3 };
These are only ever linked in if the arguments to gpio_to_ionum
or ionum_to_gpio are not known at compile time.
uint8_t IRAM gpio_to_iomux(const uint8_t gpio_number)
{
return GPIO_TO_IOMUX[gpio_number];
}
Arrays are declared as 32-bit integers in IROM to save RAM.
*/
const IROM uint32_t GPIO_TO_IOMUX_MAP[] = _GPIO_TO_IOMUX;
const IROM uint32_t IOMUX_TO_GPIO_MAP[] = _IOMUX_TO_GPIO;
uint8_t IRAM iomux_to_gpio(const uint8_t iomux_number)
{
return IOMUX_TO_GPIO[iomux_number];
}