Skip to content

Commit

Permalink
#92
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jan 30, 2021
1 parent 495ab6f commit c725b5e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/eez/modules/dib-mio168/dib-mio168.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4118,7 +4118,7 @@ void onSetPinLabel(char *value) {
char pinLabels[8 * (CHANNEL_LABEL_MAX_LENGTH + 1)];
memcpy(pinLabels, label, 8 * (CHANNEL_LABEL_MAX_LENGTH + 1));

strcpy(pinLabels + g_editLabelPinIndex * (CHANNEL_LABEL_MAX_LENGTH + 1), value);
stringCopy(pinLabels + g_editLabelPinIndex * (CHANNEL_LABEL_MAX_LENGTH + 1), CHANNEL_LABEL_MAX_LENGTH + 1, value);

LabelsAndColorsPage::setChannelLabel(g_editLabelSlotIndex, g_editSubchannelIndex, pinLabels);

Expand Down
14 changes: 7 additions & 7 deletions src/eez/modules/psu/devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ bool getDevice(int deviceIndex, Device &device) {

if (deviceIndex == i++) {
device.id = DEVICE_ID_EEPROM;
strcpy(device.name, "EEPROM");
stringCopy(device.name, sizeof(device.name), "EEPROM");
#if OPTION_EXT_EEPROM
device.installed = true;
device.testResult = mcu::eeprom::g_testResult;
Expand All @@ -85,15 +85,15 @@ bool getDevice(int deviceIndex, Device &device) {

if (deviceIndex == i++) {
device.id = DEVICE_ID_SD_CARD;
strcpy(device.name, "SD card");
stringCopy(device.name, sizeof(device.name), "SD card");
device.installed = true;
device.testResult = sd_card::g_testResult;
return true;
}

if (deviceIndex == i++) {
device.id = DEVICE_ID_ETHERNET;
strcpy(device.name, "Ethernet");
stringCopy(device.name, sizeof(device.name), "Ethernet");
#if OPTION_ETHERNET
device.installed = true;
device.testResult = ethernet::g_testResult;
Expand All @@ -106,7 +106,7 @@ bool getDevice(int deviceIndex, Device &device) {

if (deviceIndex == i++) {
device.id = DEVICE_ID_RTC;
strcpy(device.name, "RTC");
stringCopy(device.name, sizeof(device.name), "RTC");
#if OPTION_EXT_RTC
device.installed = true;
device.testResult = rtc::g_testResult;
Expand All @@ -119,15 +119,15 @@ bool getDevice(int deviceIndex, Device &device) {

if (deviceIndex == i++) {
device.id = DEVICE_ID_DATETIME;
strcpy(device.name, "DateTime");
stringCopy(device.name, sizeof(device.name), "DateTime");
device.installed = true;
device.testResult = datetime::g_testResult;
return true;
}

if (deviceIndex == i++) {
device.id = DEVICE_ID_FAN;
strcpy(device.name, "Fan");
stringCopy(device.name, sizeof(device.name), "Fan");
#if OPTION_FAN
device.installed = true;
device.testResult = aux_ps::fan::g_testResult;
Expand All @@ -140,7 +140,7 @@ bool getDevice(int deviceIndex, Device &device) {

if (deviceIndex == i++) {
device.id = DEVICE_ID_AUX_TEMP;
strcpy(device.name, "AUX temp");
stringCopy(device.name, sizeof(device.name), "AUX temp");
device.installed = true;
device.testResult = temp_sensor::sensors[temp_sensor::AUX].g_testResult;
return true;
Expand Down
8 changes: 4 additions & 4 deletions src/eez/modules/psu/scpi/diag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,19 @@ scpi_result_t scpi_cmd_diagnosticInformationAdcQ(scpi_t *context) {

char buffer[64] = { 0 };

strcpy(buffer, "U_SET=");
stringCopy(buffer, sizeof(buffer), "U_SET=");
stringAppendVoltage(buffer, sizeof(buffer), channel->u.mon_dac_last);
SCPI_ResultText(context, buffer);

strcpy(buffer, "U_MON=");
stringCopy(buffer, sizeof(buffer), "U_MON=");
stringAppendVoltage(buffer, sizeof(buffer), channel->u.mon_last);
SCPI_ResultText(context, buffer);

strcpy(buffer, "I_SET=");
stringCopy(buffer, sizeof(buffer), "I_SET=");
stringAppendCurrent(buffer, sizeof(buffer), channel->i.mon_dac_last);
SCPI_ResultText(context, buffer);

strcpy(buffer, "I_MON=");
stringCopy(buffer, sizeof(buffer), "I_MON=");
stringAppendCurrent(buffer, sizeof(buffer), channel->i.mon_last);
SCPI_ResultText(context, buffer);

Expand Down
16 changes: 8 additions & 8 deletions src/eez/modules/psu/scpi/inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ scpi_result_t scpi_cmd_instrumentCoupleTrackingQ(scpi_t *context) {

channel_dispatcher::CouplingType couplingType = channel_dispatcher::getCouplingType();
if (couplingType == channel_dispatcher::COUPLING_TYPE_PARALLEL) {
strcpy(result, "PARALLEL");
stringCopy(result, sizeof(result), "PARALLEL");
} else if (couplingType == channel_dispatcher::COUPLING_TYPE_SERIES) {
strcpy(result, "SERIES");
stringCopy(result, sizeof(result), "SERIES");
} else if (couplingType == channel_dispatcher::COUPLING_TYPE_COMMON_GND) {
strcpy(result, "CGND");
stringCopy(result, sizeof(result), "CGND");
} else if (couplingType == channel_dispatcher::COUPLING_TYPE_SPLIT_RAILS) {
strcpy(result, "SRAIL");
stringCopy(result, sizeof(result), "SRAIL");
} else {
strcpy(result, "NONE");
stringCopy(result, sizeof(result), "NONE");
}

SCPI_ResultText(context, result);
Expand Down Expand Up @@ -222,11 +222,11 @@ scpi_result_t scpi_cmd_instrumentDisplayTraceQ(scpi_t *context) {
char result[16];

if (type == DISPLAY_VALUE_VOLTAGE) {
strcpy(result, "VOLT");
stringCopy(result, sizeof(result), "VOLT");
} else if (type == DISPLAY_VALUE_CURRENT) {
strcpy(result, "CURR");
stringCopy(result, sizeof(result), "CURR");
} else {
strcpy(result, "POW");
stringCopy(result, sizeof(result), "POW");
}

SCPI_ResultText(context, result);
Expand Down

0 comments on commit c725b5e

Please sign in to comment.