From f43ef3a8b6ef465355cb0321d9027f8ccff6f33d Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 16 Jan 2022 15:34:35 -0500 Subject: [PATCH] warning(CUSTOM_ERR_6586, "attempting to change unassigned pin") --- firmware/controllers/system/efi_gpio.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/firmware/controllers/system/efi_gpio.cpp b/firmware/controllers/system/efi_gpio.cpp index 5e06b9a1a9..e5d1805dbb 100644 --- a/firmware/controllers/system/efi_gpio.cpp +++ b/firmware/controllers/system/efi_gpio.cpp @@ -404,6 +404,11 @@ bool OutputPin::getAndSet(int logicValue) { // This function is only used on real hardware #if EFI_PROD_CODE void OutputPin::setOnchipValue(int electricalValue) { + if (brainPin == GPIO_UNASSIGNED || brainPin == GPIO_INVALID) { + // todo: make 'setOnchipValue' or 'reportsetOnchipValueError' virtual and override for NamedOutputPin? + warning(CUSTOM_ERR_6586, "attempting to change unassigned pin"); + return; + } palWritePad(port, pin, electricalValue); } #endif // EFI_PROD_CODE