Skip to content

Commit

Permalink
#161 fix for println 64 chars limit
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Aug 29, 2017
1 parent b2d7fb7 commit 8fd83fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions eez_psu_sketch/scpi_psu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ void printError(int_fast16_t err) {
if (serial::g_testResult == TEST_OK) {
char errorOutputBuffer[256];

SERIAL_PORT.print("**ERROR");

char datetime_buffer[20] = { 0 };
if (datetime::getDateTimeAsString(datetime_buffer)) {
sprintf_P(errorOutputBuffer, PSTR("**ERROR [%s]: %d,\"%s\"\r\n"), datetime_buffer, (int16_t)err, SCPI_ErrorTranslate(err));
} else {
sprintf_P(errorOutputBuffer, PSTR("**ERROR: %d,\"%s\"\r\n"), (int16_t)err, SCPI_ErrorTranslate(err));
sprintf_P(errorOutputBuffer, PSTR(" [%s]"), datetime_buffer);
SERIAL_PORT.print(errorOutputBuffer);
}

sprintf_P(errorOutputBuffer, PSTR(": %d,\"%s\""), (int16_t)err, SCPI_ErrorTranslate(err));
SERIAL_PORT.println(errorOutputBuffer);
}

Expand Down

0 comments on commit 8fd83fa

Please sign in to comment.