Skip to content

Commit e9b7157

Browse files
authored
Merge pull request #1963 from elcojacobs/fix/gpio-hal-startup
Ensure gpio pin map is initialized on first use for gcc build
2 parents 2d26787 + f420cef commit e9b7157

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: hal/src/gcc/gpio_hal.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,13 @@ class GpioPinMap
178178
}
179179
};
180180

181-
GpioPinMap PIN_MAP;
181+
GpioPinMap& _fetch_PIN_MAP()
182+
{
183+
static GpioPinMap pinMap;
184+
return pinMap;
185+
}
186+
187+
#define PIN_MAP _fetch_PIN_MAP()
182188

183189

184190
PinFunction HAL_Validate_Pin_Function(pin_t pin, PinFunction pinFunction)

0 commit comments

Comments
 (0)