Skip to content

Commit

Permalink
DBGMCU->IDCODE
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 11, 2020
1 parent 936e362 commit 6be3ef9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/eez/modules/psu/scpi/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include <math.h>
#include <stdio.h>

#if EEZ_PLATFORM_STM32
#include <main.h>
#endif

#include <eez/firmware.h>
#include <eez/system.h>

Expand Down Expand Up @@ -140,6 +144,13 @@ scpi_result_t scpi_cmd_debugQ(scpi_t *context) {
} else if (cmd == 24) {
SCPI_ResultText(context, MCU_FIRMWARE_BUILD_DATE " " MCU_FIRMWARE_BUILD_TIME);
return SCPI_RES_OK;
} else if (cmd == 25) {
#if EEZ_PLATFORM_STM32
char idCode[20];
snprintf(idCode, sizeof(idCode), "0x%08X", (unsigned int)DBGMCU->IDCODE);
SCPI_ResultText(context, idCode);
#endif
return SCPI_RES_OK;
} else {
SCPI_ErrorPush(context, SCPI_ERROR_HARDWARE_MISSING);
return SCPI_RES_ERR;
Expand Down

0 comments on commit 6be3ef9

Please sign in to comment.