Skip to content

Commit

Permalink
#53
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Sep 18, 2020
1 parent 8ad329f commit ce50b22
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/eez/modules/psu/gui/page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <eez/modules/psu/psu.h>
#include <eez/modules/psu/gui/psu.h>

#include <scpi/scpi.h>

using namespace eez::mcu;

namespace eez {
Expand Down Expand Up @@ -120,8 +122,20 @@ ToastMessagePage *ToastMessagePage::create(ToastType type, const char *message,
////////////////////////////////////////

void ToastMessagePage::onEncoder(int counter) {
if (counter < 0 || !hasAction()) {
popPage();
if (counter < 0) {
if (hasAction()) {
if (messageValue.getType() == VALUE_TYPE_SCPI_ERROR) {
if (
messageValue.getFirstInt16() == SCPI_ERROR_VOLTAGE_LIMIT_EXCEEDED ||
messageValue.getFirstInt16() == SCPI_ERROR_CURRENT_LIMIT_EXCEEDED ||
messageValue.getFirstInt16() == SCPI_ERROR_POWER_LIMIT_EXCEEDED
) {
popPage();
}
}
} else {
popPage();
}
}
}

Expand Down

0 comments on commit ce50b22

Please sign in to comment.