Skip to content

Commit

Permalink
BP3C test
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Apr 16, 2020
1 parent 382d3dd commit 932636f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/eez/modules/psu/event_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ static const int EVENT_TYPE_ERROR = 4;
EVENT_ERROR(SLOT3_SYNC_ERROR, 142, "Sync error on module 3") \
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_WARNING(CH1_CALIBRATION_DISABLED, 0, "Ch1 calibration disabled") \
EVENT_WARNING(CH2_CALIBRATION_DISABLED, 1, "Ch2 calibration disabled") \
EVENT_WARNING(CH3_CALIBRATION_DISABLED, 2, "Ch3 calibration disabled") \
Expand Down
18 changes: 18 additions & 0 deletions src/eez/modules/psu/scpi/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ scpi_result_t scpi_cmd_debug(scpi_t *context) {
//
} else if (cmd == 26) {
psu::gui::showPage(PAGE_ID_DEBUG_VARIABLES);
} else if (cmd == 27) {
int32_t relay;
if (SCPI_ParamInt32(context, &relay, true)) {
bp3c::io_exp::switchChannelCoupling(relay);
}
} else {
SCPI_ErrorPush(context, SCPI_ERROR_HARDWARE_MISSING);
return SCPI_RES_ERR;
Expand All @@ -95,6 +100,19 @@ scpi_result_t scpi_cmd_debug(scpi_t *context) {

scpi_result_t scpi_cmd_debugQ(scpi_t *context) {
#ifdef DEBUG
int32_t cmd;
if (SCPI_ParamInt32(context, &cmd, false)) {
if (cmd == 23) {
bp3c::io_exp::init();
bp3c::io_exp::test();
SCPI_ResultBool(context, bp3c::io_exp::g_testResult == TEST_OK);
return SCPI_RES_OK;
} else {
SCPI_ErrorPush(context, SCPI_ERROR_HARDWARE_MISSING);
return SCPI_RES_ERR;
}
}

static char buffer[2048];

#ifndef __EMSCRIPTEN__
Expand Down

0 comments on commit 932636f

Please sign in to comment.