From b0361f888409cffba62424359a9b77003f5ac678 Mon Sep 17 00:00:00 2001 From: rusefi Date: Thu, 23 Nov 2023 11:38:08 -0500 Subject: [PATCH] bench test 33810 module #5745 only:f407-discovery --- firmware/config/boards/f407-discovery/board_extra.cpp | 2 +- firmware/hw_layer/drivers/gpio/mc33810.cpp | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/firmware/config/boards/f407-discovery/board_extra.cpp b/firmware/config/boards/f407-discovery/board_extra.cpp index 67fdee9433..88eb58e92f 100644 --- a/firmware/config/boards/f407-discovery/board_extra.cpp +++ b/firmware/config/boards/f407-discovery/board_extra.cpp @@ -189,7 +189,7 @@ static const struct mc33810_config mc33810 = { if (engineConfiguration->engineType == engine_type_e::FRANKENSO_TEST_33810) { int ret = mc33810_add(Gpio::MC33810_0_OUT_0, 0, &mc33810); - efiPrintf("****************** mc33810_add %d ********************", ret); + efiPrintf("*****************+ mc33810_add %d +*******************", ret); // todo: add to more appropriate location? diff --git a/firmware/hw_layer/drivers/gpio/mc33810.cpp b/firmware/hw_layer/drivers/gpio/mc33810.cpp index 0d2e608e47..af33f936cf 100644 --- a/firmware/hw_layer/drivers/gpio/mc33810.cpp +++ b/firmware/hw_layer/drivers/gpio/mc33810.cpp @@ -538,10 +538,7 @@ int Mc33810::init() * @details Checks for valid config */ -int mc33810_add(brain_pin_e base, unsigned int index, const mc33810_config *cfg) -{ - int i; - int ret; +int mc33810_add(brain_pin_e base, unsigned int index, const mc33810_config *cfg) { /* no config or no such chip */ if ((!cfg) || (!cfg->spi_bus) || (index >= BOARD_MC33810_COUNT)) @@ -563,7 +560,7 @@ int mc33810_add(brain_pin_e base, unsigned int index, const mc33810_config *cfg) chip.o_state_cached = 0; chip.o_direct_mask = 0; chip.drv_state = MC33810_WAIT_INIT; - for (i = 0; i < MC33810_DIRECT_OUTPUTS; i++) { + for (int i = 0; i < MC33810_DIRECT_OUTPUTS; i++) { if (cfg->direct_io[i].port != 0) chip.o_direct_mask |= BIT(i); } @@ -574,7 +571,7 @@ int mc33810_add(brain_pin_e base, unsigned int index, const mc33810_config *cfg) return -4; /* register, return gpio chip base */ - ret = gpiochip_register(base, DRIVER_NAME, chip, MC33810_OUTPUTS); + int ret = gpiochip_register(base, DRIVER_NAME, chip, MC33810_OUTPUTS); if (ret < 0) return ret;