mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-15 04:37:07 +01:00
gpio: always propogate source location
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user