Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed May 28, 2021
1 parent 1af9d99 commit e347028
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 24 deletions.
23 changes: 15 additions & 8 deletions src/eez/modules/dib-mux14d/dib-mux14d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ struct Response {

union {
struct {
uint16_t moduleType;
uint8_t firmwareMajorVersion;
uint8_t firmwareMinorVersion;
uint32_t idw0;
Expand Down Expand Up @@ -277,16 +278,22 @@ struct Mux14DModule : public Module {
if (isSuccess) {
auto &data = response.getInfo;

firmwareMajorVersion = data.firmwareMajorVersion;
firmwareMinorVersion = data.firmwareMinorVersion;
idw0 = data.idw0;
idw1 = data.idw1;
idw2 = data.idw2;
if (data.moduleType == MODULE_TYPE_DIB_MUX14D) {
firmwareMajorVersion = data.firmwareMajorVersion;
firmwareMinorVersion = data.firmwareMinorVersion;
idw0 = data.idw0;
idw1 = data.idw1;
idw2 = data.idw2;

firmwareVersionAcquired = true;
firmwareVersionAcquired = true;

synchronized = true;
testResult = TEST_OK;
synchronized = true;
testResult = TEST_OK;
} else {
synchronized = false;
testResult = TEST_FAILED;
event_queue::pushEvent(event_queue::EVENT_ERROR_SLOT1_FIRMWARE_MISMATCH + slotIndex);
}
} else {
synchronized = false;
if (firmwareInstalled) {
Expand Down
23 changes: 15 additions & 8 deletions src/eez/modules/dib-prel6/dib-prel6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ struct Response {

union {
struct {
uint16_t moduleType;
uint8_t firmwareMajorVersion;
uint8_t firmwareMinorVersion;
uint32_t idw0;
Expand Down Expand Up @@ -251,16 +252,22 @@ struct Prel6Module : public Module {
if (isSuccess) {
auto &data = response.getInfo;

firmwareMajorVersion = data.firmwareMajorVersion;
firmwareMinorVersion = data.firmwareMinorVersion;
idw0 = data.idw0;
idw1 = data.idw1;
idw2 = data.idw2;
if (data.moduleType == MODULE_TYPE_DIB_PREL6) {
firmwareMajorVersion = data.firmwareMajorVersion;
firmwareMinorVersion = data.firmwareMinorVersion;
idw0 = data.idw0;
idw1 = data.idw1;
idw2 = data.idw2;

firmwareVersionAcquired = true;
firmwareVersionAcquired = true;

synchronized = true;
testResult = TEST_OK;
synchronized = true;
testResult = TEST_OK;
} else {
synchronized = false;
testResult = TEST_FAILED;
event_queue::pushEvent(event_queue::EVENT_ERROR_SLOT1_FIRMWARE_MISMATCH + slotIndex);
}
} else {
synchronized = false;
if (firmwareInstalled) {
Expand Down
23 changes: 15 additions & 8 deletions src/eez/modules/dib-smx46/dib-smx46.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ struct Response {

union {
struct {
uint16_t moduleType;
uint8_t firmwareMajorVersion;
uint8_t firmwareMinorVersion;
uint32_t idw0;
Expand Down Expand Up @@ -300,16 +301,22 @@ struct Smx46Module : public Module {
if (isSuccess) {
auto &data = response.getInfo;

firmwareMajorVersion = data.firmwareMajorVersion;
firmwareMinorVersion = data.firmwareMinorVersion;
idw0 = data.idw0;
idw1 = data.idw1;
idw2 = data.idw2;
if (data.moduleType == MODULE_TYPE_DIB_SMX46) {
firmwareMajorVersion = data.firmwareMajorVersion;
firmwareMinorVersion = data.firmwareMinorVersion;
idw0 = data.idw0;
idw1 = data.idw1;
idw2 = data.idw2;

firmwareVersionAcquired = true;
firmwareVersionAcquired = true;

synchronized = true;
testResult = TEST_OK;
synchronized = true;
testResult = TEST_OK;
} else {
synchronized = false;
testResult = TEST_FAILED;
event_queue::pushEvent(event_queue::EVENT_ERROR_SLOT1_FIRMWARE_MISMATCH + slotIndex);
}
} else {
synchronized = false;
if (firmwareInstalled) {
Expand Down
3 changes: 3 additions & 0 deletions src/eez/modules/psu/event_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ static const int EVENT_TYPE_ERROR = 4;
EVENT_ERROR(TOO_MANY_LOG_EVENTS, 150, "Too many log events") \
EVENT_ERROR(WATCHDOG_RESET, 151, "Watchdog reset") \
EVENT_ERROR(HIGH_TEMPERATURE, 152, "High temperature") \
EVENT_ERROR(SLOT1_FIRMWARE_MISMATCH, 160, "Firmware mismatch on module 1") \
EVENT_ERROR(SLOT2_FIRMWARE_MISMATCH, 161, "Firmware mismatch on module 2") \
EVENT_ERROR(SLOT3_FIRMWARE_MISMATCH, 162, "Firmware mismatch on module 3") \
EVENT_WARNING(CH_CALIBRATION_DISABLED, 0, "Ch%d calibration disabled") \
EVENT_WARNING(ETHERNET_NOT_CONNECTED, 20, "Ethernet not connected") \
EVENT_WARNING(AUTO_RECALL_VALUES_MISMATCH, 21, "Auto-recall values mismatch") \
Expand Down

0 comments on commit e347028

Please sign in to comment.