diff --git a/firmware/controllers/system/efi_gpio.h b/firmware/controllers/system/efi_gpio.h index 19ec69ae6f..0c12fb8cd1 100644 --- a/firmware/controllers/system/efi_gpio.h +++ b/firmware/controllers/system/efi_gpio.h @@ -196,5 +196,6 @@ const char *portname(ioportid_t GPIOx); #endif /* EFI_GPIO_HARDWARE */ +void printSpiConfig(Logging *logging, const char *msg, spi_device_e device); brain_pin_e parseBrainPin(const char *str); const char *hwPortname(brain_pin_e brainPin); diff --git a/firmware/hw_layer/hip9011.cpp b/firmware/hw_layer/hip9011.cpp index 1dbbd94410..1a847dfd68 100644 --- a/firmware/hw_layer/hip9011.cpp +++ b/firmware/hw_layer/hip9011.cpp @@ -173,9 +173,7 @@ static void showHipInfo(void) { getPinNameByAdcChannel("hip", engineConfiguration->hipOutputChannel, pinNameBuffer), hipValueMax, CONFIG(useTpicAdvancedMode)); - scheduleMsg(logger, "mosi=%s", hwPortname(getMosiPin(engineConfiguration->hip9011SpiDevice))); - scheduleMsg(logger, "miso=%s", hwPortname(getMisoPin(engineConfiguration->hip9011SpiDevice))); - scheduleMsg(logger, "sck=%s", hwPortname(getSckPin(engineConfiguration->hip9011SpiDevice))); + printSpiConfig(logger, "hip9011", CONFIG(hip9011SpiDevice)); #endif /* EFI_PROD_CODE */ scheduleMsg(logger, "start %.2f end %.2f", engineConfiguration->knockDetectionWindowStart, diff --git a/firmware/hw_layer/pin_repository.cpp b/firmware/hw_layer/pin_repository.cpp index bfa3970297..d58e120af9 100644 --- a/firmware/hw_layer/pin_repository.cpp +++ b/firmware/hw_layer/pin_repository.cpp @@ -17,6 +17,7 @@ #include "memstreams.h" #include "drivers/gpio/gpio_ext.h" #include "smart_gpio.h" +#include "hardware.h" static bool initialized = false; @@ -174,6 +175,12 @@ static void reportPins(void) { static MemoryStream portNameStream; static char portNameBuffer[20]; +void printSpiConfig(Logging *logging, const char *msg, spi_device_e device) { + scheduleMsg(logging, "%s %s mosi=%s", msg, getSpi_device_e(device), hwPortname(getMosiPin(device))); + scheduleMsg(logging, "%s %s miso=%s", msg, getSpi_device_e(device), hwPortname(getMisoPin(device))); + scheduleMsg(logging, "%s %s sck=%s", msg, getSpi_device_e(device), hwPortname(getSckPin(device))); +} + const char *hwPortname(brain_pin_e brainPin) { if (brainPin == GPIO_INVALID) { return "INVALID";