initial_pins: Add compile time check to reduce binary size when not in use

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-05-16 16:35:45 -04:00 committed by Eric Callahan
parent d6c874b0ad
commit e8374ce367

View File

@ -16,6 +16,8 @@ DECL_CTR("DECL_INITIAL_PINS " __stringify(CONFIG_INITIAL_PINS));
void
initial_pins_setup(void)
{
if (sizeof(CONFIG_INITIAL_PINS) <= 1)
return;
int i;
for (i=0; i<initial_pins_size; i++) {
const struct initial_pin_s *ip = &initial_pins[i];