diff --git a/firmware/controllers/system/efiGpio.cpp b/firmware/controllers/system/efiGpio.cpp index 7a0c026658..f409fe455b 100644 --- a/firmware/controllers/system/efiGpio.cpp +++ b/firmware/controllers/system/efiGpio.cpp @@ -260,9 +260,36 @@ void turnAllPinsOff(void) { enginePins.coils[i].setValue(false); } } + + +/** + * @deprecated - use hwPortname() instead + */ +const char *portname(ioportid_t GPIOx) { + if (GPIOx == GPIOA) + return "PA"; + if (GPIOx == GPIOB) + return "PB"; + if (GPIOx == GPIOC) + return "PC"; + if (GPIOx == GPIOD) + return "PD"; +#if defined(STM32F4XX) + if (GPIOx == GPIOE) + return "PE"; + if (GPIOx == GPIOH) + return "PH"; +#endif + if (GPIOx == GPIOF) + return "PF"; + return "unknown"; +} + #else /* EFI_GPIO_HARDWARE */ const char *hwPortname(brain_pin_e brainPin) { (void)brainPin; return "N/A"; } #endif /* EFI_GPIO_HARDWARE */ + + diff --git a/firmware/hw_layer/pin_repository.cpp b/firmware/hw_layer/pin_repository.cpp index e704fa4db9..05ad0a0d63 100644 --- a/firmware/hw_layer/pin_repository.cpp +++ b/firmware/hw_layer/pin_repository.cpp @@ -36,29 +36,6 @@ static ioportid_t ports[7] = {GPIOA, PinRepository::PinRepository() { } -/** - * @deprecated - use hwPortname() instead - */ -const char *portname(ioportid_t GPIOx) { - if (GPIOx == GPIOA) - return "PA"; - if (GPIOx == GPIOB) - return "PB"; - if (GPIOx == GPIOC) - return "PC"; - if (GPIOx == GPIOD) - return "PD"; -#if defined(STM32F4XX) - if (GPIOx == GPIOE) - return "PE"; - if (GPIOx == GPIOH) - return "PH"; -#endif - if (GPIOx == GPIOF) - return "PF"; - return "unknown"; -} - static int getPortIndex(ioportid_t port) { efiAssert(port != NULL, "null port", -1); if (port == GPIOA) @@ -208,16 +185,3 @@ void unmarkPin(brain_pin_e brainPin) { } } -/** - * This method would crash the program if pin is already in use - */ -void registedFundamentralIoPin(char *msg, ioportid_t port, ioportmask_t pin, iomode_t mode) { - efiAssertVoid(initialized, "repo not initialized"); - - bool wasUsed = markUsed(port, pin, msg); - if (wasUsed) { - return; - } - palSetPadMode(port, pin, mode); -} -