bench test 33810 module #5745

only:f407-discovery
This commit is contained in:
rusefi 2023-11-23 11:38:08 -05:00
parent b92c57e34d
commit b0361f8884
2 changed files with 4 additions and 7 deletions

View File

@ -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?

View File

@ -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;