parent
e2cf0ef0aa
commit
7dc1c78bf5
|
@ -96,8 +96,6 @@ struct Mc33810 : public GpioChip {
|
|||
int writePad(size_t pin, int value) override;
|
||||
brain_pin_diag_e getDiag(size_t pin) override;
|
||||
|
||||
|
||||
|
||||
// internal functions
|
||||
int spi_rw(uint16_t tx, uint16_t* rx);
|
||||
int update_output_and_diag();
|
||||
|
@ -110,6 +108,7 @@ struct Mc33810 : public GpioChip {
|
|||
bool hasBindedPins = false;
|
||||
|
||||
const mc33810_config *cfg;
|
||||
|
||||
/* cached output state - state last send to chip */
|
||||
uint8_t o_state_cached;
|
||||
/* state to be sent to chip */
|
||||
|
@ -526,14 +525,16 @@ int Mc33810::writePad(size_t pin, int value)
|
|||
/* direct driven? */
|
||||
if (o_direct_mask & BIT(pin)) {
|
||||
/* TODO: ensure that output driver enabled */
|
||||
int pad = PAL_PORT_BIT(cfg->direct_io[pin].pad);
|
||||
#if MC33810_VERBOSE
|
||||
int pad = PAL_PORT_BIT(cfg->direct_io[pin].pad);
|
||||
efiPrintf(DRIVER_NAME "writePad pad %d", pad);
|
||||
#endif
|
||||
if (value) {
|
||||
palSetPort(cfg->direct_io[pin].port, pad);
|
||||
palSetPort(cfg->direct_io[pin].port,
|
||||
PAL_PORT_BIT(cfg->direct_io[pin].pad));
|
||||
} else {
|
||||
palClearPort(cfg->direct_io[pin].port, pad);
|
||||
palClearPort(cfg->direct_io[pin].port,
|
||||
PAL_PORT_BIT(cfg->direct_io[pin].pad));
|
||||
}
|
||||
} else {
|
||||
#if MC33810_VERBOSE
|
||||
|
@ -555,7 +556,7 @@ brain_pin_diag_e Mc33810::getDiag(size_t pin)
|
|||
|
||||
if (pin < 4) {
|
||||
/* OUT drivers */
|
||||
val = out_fault[pin < 2 ? 0 : 1] >> (4 * (pin & 0x01));
|
||||
val = out_fault[(pin < 2) ? 0 : 1] >> (4 * (pin & 0x01));
|
||||
|
||||
/* ON open fault */
|
||||
if (val & BIT(0))
|
||||
|
|
Loading…
Reference in New Issue