Skip to content

Commit

Permalink
Pin state is a pin voltage level, not a logic (active-high/low) level
Browse files Browse the repository at this point in the history
  • Loading branch information
ezshinoda committed Jan 28, 2019
1 parent 6c8b3a7 commit 06e7a73
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/drivers/pinio.c
Expand Up @@ -51,6 +51,11 @@ void pinioInit(const pinioConfig_t *pinioConfig)

switch (pinioConfig->config[i] & PINIO_CONFIG_MODE_MASK) {
case PINIO_CONFIG_MODE_OUT_PP:
// Initial state after reset is input, pull-up.
// Avoid momentary off by presetting the output to hi.
if (pinioConfig->config[i] & PINIO_CONFIG_OUT_INVERTED) {
IOHi(io);
}
IOConfigGPIO(io, IOCFG_OUT_PP);
break;
}
Expand All @@ -59,12 +64,13 @@ void pinioInit(const pinioConfig_t *pinioConfig)
{
pinioRuntime[i].inverted = true;
IOHi(io);
pinioRuntime[i].state = true;
} else {
pinioRuntime[i].inverted = false;
IOLo(io);
pinioRuntime[i].state = false;
}
pinioRuntime[i].io = io;
pinioRuntime[i].state = false;
}
}

Expand Down

0 comments on commit 06e7a73

Please sign in to comment.