@@ -119,6 +119,9 @@ struct DcmChannel : public Channel {
119
119
float iSet;
120
120
#endif
121
121
122
+ uint16_t uMonAdc = 0 ;
123
+ uint16_t iMonAdc = 0 ;
124
+
122
125
float temperature = 25 .0f ;
123
126
124
127
float I_MAX_FOR_REMAP;
@@ -447,6 +450,22 @@ struct DcmChannel : public Channel {
447
450
}
448
451
}
449
452
}
453
+
454
+ void dumpDebugVariables (scpi_t *context) override {
455
+ char buffer[100 ];
456
+
457
+ snprintf (buffer, sizeof (buffer), " CH%d U_DAC = %d" , channelIndex + 1 , (int )uSet);
458
+ SCPI_ResultText (context, buffer);
459
+
460
+ snprintf (buffer, sizeof (buffer), " CH%d U_MON = %d" , channelIndex + 1 , (int )uMonAdc);
461
+ SCPI_ResultText (context, buffer);
462
+
463
+ snprintf (buffer, sizeof (buffer), " CH%d I_DAC = %d" , channelIndex + 1 , (int )iSet);
464
+ SCPI_ResultText (context, buffer);
465
+
466
+ snprintf (buffer, sizeof (buffer), " CH%d I_MON = %d" , channelIndex + 1 , (int )iMonAdc);
467
+ SCPI_ResultText (context, buffer);
468
+ }
450
469
};
451
470
452
471
static const float DEFAULT_COUNTERPHASE_FREQUENCY = 500000 .0f ;
@@ -1066,10 +1085,12 @@ void DcmModule::tick(uint8_t slotIndex) {
1066
1085
channel.ccMode = (input[0 ] & (subchannelIndex == 0 ? REG0_CC1_MASK : REG0_CC2_MASK)) != 0 ;
1067
1086
1068
1087
uint16_t uMonAdc = inputSetValues[offset];
1088
+ channel.uMonAdc = uMonAdc;
1069
1089
float uMon = remap (uMonAdc, (float )ADC_MIN, 0 , (float )ADC_MAX, channel.params .U_MAX );
1070
1090
channel.onAdcData (ADC_DATA_TYPE_U_MON, uMon);
1071
1091
1072
1092
uint16_t iMonAdc = inputSetValues[offset + 1 ];
1093
+ channel.iMonAdc = iMonAdc;
1073
1094
const float FULL_SCALE = 2 .0F ;
1074
1095
const float U_REF = 2 .5F ;
1075
1096
float iMon = remap (iMonAdc, (float )ADC_MIN, 0 , FULL_SCALE * ADC_MAX / U_REF, /* params.I_MAX*/ channel.I_MAX_FOR_REMAP );
0 commit comments