diff options
-rw-r--r-- | board/samus_pd/board.h | 1 | ||||
-rw-r--r-- | include/config.h | 6 | ||||
-rw-r--r-- | include/gpio_list.h | 5 |
3 files changed, 12 insertions, 0 deletions
diff --git a/board/samus_pd/board.h b/board/samus_pd/board.h index bcfb2e96b7..931876df27 100644 --- a/board/samus_pd/board.h +++ b/board/samus_pd/board.h @@ -21,6 +21,7 @@ #define CONFIG_CHARGE_MANAGER /* Minimum ilim = 500 mA */ #define CONFIG_CHARGER_INPUT_CURRENT PWM_0_MA +#define CONFIG_COMMON_GPIO_SHORTNAMES #undef CONFIG_CONSOLE_CMDHELP #define CONFIG_FORCE_CONSOLE_RESUME #define CONFIG_HIBERNATE_WAKEUP_PINS (STM32_PWR_CSR_EWUP3|STM32_PWR_CSR_EWUP8) diff --git a/include/config.h b/include/config.h index d48b16dbac..ac936f61ba 100644 --- a/include/config.h +++ b/include/config.h @@ -349,6 +349,12 @@ #define CONFIG_COMMON_GPIO /* + * Provides smaller GPIO names to reduce flash size. Instead of the 'name' + * field in GPIO macro it will concat 'port' and 'pin' to reduce flash size. + */ +#undef CONFIG_COMMON_GPIO_SHORTNAMES + +/* * Provide common runtime layer code (tasks, hooks ...) * You want this unless you are doing a really tiny firmware. */ diff --git a/include/gpio_list.h b/include/gpio_list.h index 4ea1da27a3..c7e2962747 100644 --- a/include/gpio_list.h +++ b/include/gpio_list.h @@ -3,8 +3,13 @@ * found in the LICENSE file. */ +#ifdef CONFIG_COMMON_GPIO_SHORTNAMES +#define GPIO(name, port, pin, flags, signal) \ + {#port#pin, GPIO_##port, (1 << pin), flags, signal}, +#else #define GPIO(name, port, pin, flags, signal) \ {#name, GPIO_##port, (1 << pin), flags, signal}, +#endif #define UNIMPLEMENTED(name) \ {#name, DUMMY_GPIO_BANK, 0, GPIO_DEFAULT, NULL}, |