Skip to content

Commit b9dcf3e

Browse files
committed
gpio: always propogate source location
1 parent fc3dbc6 commit b9dcf3e

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

code/espurna/gpio.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,18 +814,20 @@ GpioBase* gpioBase(GpioType type) {
814814
return ptr;
815815
}
816816

817-
BasePinPtr gpioRegister(GpioBase& base, unsigned char gpio) {
817+
BasePinPtr gpioRegister(GpioBase& base, unsigned char gpio,
818+
espurna::SourceLocation source_location)
819+
{
818820
BasePinPtr result;
819821

820-
if (gpioLock(base, gpio)) {
822+
if (gpioLock(base, gpio, source_location)) {
821823
result = base.pin(gpio);
822824
}
823825

824826
return result;
825827
}
826828

827-
BasePinPtr gpioRegister(unsigned char gpio) {
828-
return gpioRegister(hardwareGpio(), gpio);
829+
BasePinPtr gpioRegister(unsigned char gpio, espurna::SourceLocation source_location) {
830+
return gpioRegister(hardwareGpio(), gpio, source_location);
829831
}
830832

831833
void gpioSetup() {

code/espurna/gpio.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ GpioBase* gpioBase(GpioType);
5555
GpioBase& hardwareGpio();
5656
void hardwareGpioIgnore(unsigned char gpio);
5757

58-
BasePinPtr gpioRegister(GpioBase& base, unsigned char gpio);
59-
BasePinPtr gpioRegister(unsigned char gpio);
60-
6158
void gpioLockOrigin(espurna::gpio::Origin);
6259

6360
void gpioSetup();
@@ -131,3 +128,8 @@ inline bool gpioLocked(const GpioBase& base, unsigned char gpio) {
131128
inline bool gpioLocked(unsigned char gpio) {
132129
return gpioLocked(hardwareGpio(), gpio);
133130
}
131+
132+
BasePinPtr gpioRegister(GpioBase& base, unsigned char gpio,
133+
espurna::SourceLocation source_location = espurna::make_source_location());
134+
BasePinPtr gpioRegister(unsigned char gpio,
135+
espurna::SourceLocation source_location = espurna::make_source_location());

0 commit comments

Comments
 (0)