diff --git a/code/espurna/gpio.cpp b/code/espurna/gpio.cpp index acdb0a11..a4f6387f 100644 --- a/code/espurna/gpio.cpp +++ b/code/espurna/gpio.cpp @@ -814,18 +814,20 @@ GpioBase* gpioBase(GpioType type) { return ptr; } -BasePinPtr gpioRegister(GpioBase& base, unsigned char gpio) { +BasePinPtr gpioRegister(GpioBase& base, unsigned char gpio, + espurna::SourceLocation source_location) +{ BasePinPtr result; - if (gpioLock(base, gpio)) { + if (gpioLock(base, gpio, source_location)) { result = base.pin(gpio); } return result; } -BasePinPtr gpioRegister(unsigned char gpio) { - return gpioRegister(hardwareGpio(), gpio); +BasePinPtr gpioRegister(unsigned char gpio, espurna::SourceLocation source_location) { + return gpioRegister(hardwareGpio(), gpio, source_location); } void gpioSetup() { diff --git a/code/espurna/gpio.h b/code/espurna/gpio.h index 2bc09d05..213704bc 100644 --- a/code/espurna/gpio.h +++ b/code/espurna/gpio.h @@ -55,9 +55,6 @@ GpioBase* gpioBase(GpioType); GpioBase& hardwareGpio(); void hardwareGpioIgnore(unsigned char gpio); -BasePinPtr gpioRegister(GpioBase& base, unsigned char gpio); -BasePinPtr gpioRegister(unsigned char gpio); - void gpioLockOrigin(espurna::gpio::Origin); void gpioSetup(); @@ -131,3 +128,8 @@ inline bool gpioLocked(const GpioBase& base, unsigned char gpio) { inline bool gpioLocked(unsigned char gpio) { return gpioLocked(hardwareGpio(), gpio); } + +BasePinPtr gpioRegister(GpioBase& base, unsigned char gpio, + espurna::SourceLocation source_location = espurna::make_source_location()); +BasePinPtr gpioRegister(unsigned char gpio, + espurna::SourceLocation source_location = espurna::make_source_location());