diff --git a/src/eez/modules/dib-dcp405/dib-dcp405.h b/src/eez/modules/dib-dcp405/dib-dcp405.h index a4bdf4d01..593327bfe 100644 --- a/src/eez/modules/dib-dcp405/dib-dcp405.h +++ b/src/eez/modules/dib-dcp405/dib-dcp405.h @@ -25,6 +25,7 @@ static const uint16_t MODULE_REVISION_DCP405_R2B5 = 0x0205; static const uint16_t MODULE_REVISION_DCP405_R2B7 = 0x0207; static const uint16_t MODULE_REVISION_DCP405_R2B11 = 0x020B; static const uint16_t MODULE_REVISION_DCP405_R3B1 = 0x0301; +static const uint16_t MODULE_REVISION_DCP405_R3B3 = 0x0303; namespace eez { namespace dcp405 { diff --git a/src/eez/modules/dib-dcp405/ioexp.cpp b/src/eez/modules/dib-dcp405/ioexp.cpp index 4bd7ff620..840aa372e 100644 --- a/src/eez/modules/dib-dcp405/ioexp.cpp +++ b/src/eez/modules/dib-dcp405/ioexp.cpp @@ -124,7 +124,7 @@ uint8_t IOExpander::getRegValue(int i) { } else if (reg == REG_GPIOA) { value = REG_VALUE_GPIOA; } else if (reg == REG_GPIOB) { - if (slot.moduleRevision >= MODULE_REVISION_DCP405_R3B1) { + if (slot.moduleRevision >= MODULE_REVISION_DCP405_R3B1 && slot.moduleRevision < MODULE_REVISION_DCP405_R3B3) { value = R3B1_REG_VALUE_GPIOB; } else { value = REG_VALUE_GPIOB; @@ -322,7 +322,7 @@ bool IOExpander::testBit(int io_bit) { auto result = (gpio & (1 << io_bit)) ? true : false; auto &slot = *g_slots[slotIndex]; - if (slot.moduleRevision >= MODULE_REVISION_DCP405_R3B1) { + if (slot.moduleRevision >= MODULE_REVISION_DCP405_R3B1 && slot.moduleRevision < MODULE_REVISION_DCP405_R3B3) { if (io_bit == IO_BIT_OUT_OVP_ENABLE) { result = !result; } @@ -352,7 +352,7 @@ void IOExpander::changeBit(int io_bit, bool set) { } #endif - if (slot.moduleRevision >= MODULE_REVISION_DCP405_R3B1) { + if (slot.moduleRevision >= MODULE_REVISION_DCP405_R3B1 && slot.moduleRevision < MODULE_REVISION_DCP405_R3B3) { if (io_bit == IO_BIT_OUT_OVP_ENABLE) { set = !set; }