[update] changes on DAC_VOUT

This commit is contained in:
JayC319
2022-08-11 10:46:15 +08:00
parent 6754c4b9e8
commit ba29ac9418
6 changed files with 35 additions and 18 deletions
@@ -94,7 +94,7 @@ static void WorkModeLED()
led_color_set(LED_NB_MAX, LED_BR_LV1, LED_CLR_CYAN);
break;
case CURVE_CALI_ADC:
case CURVE_CALI:
if (instru.AdcChannel == RIS_ADC_IIN) {
led_color_set(LED_NB_MAX, LED_BR_LV1, LED_CLR_RED);
} else if (instru.AdcChannel == RIS_ADC_VIN) {
@@ -791,7 +791,7 @@ int wm_init(void)
case CURVE_DPV_ADVANCE_SMPRATE:
if (__dpv_advance_create()) return -2;
break;
case CURVE_CALI_ADC:
case CURVE_CALI:
if (__adc_cali_create()) return -2;
break;
@@ -38,7 +38,7 @@ enum all_mode_e {
CURVE_DPV_ADVANCE = 0x10,
CURVE_DPV_ADVANCE_SMPRATE = 0x11,
CURVE_CALI_ADC = 0xF1, // 0xF1
CURVE_CALI = 0xF1, // 0xF1
SET_SAMPLE_RATE = 0xE0,
@@ -4,9 +4,9 @@
#define VERSION_DATE_YEAR 22
#define VERSION_DATE_MONTH 8
#define VERSION_DATE_DAY 10
#define VERSION_DATE_HOUR 18
#define VERSION_DATE_MINUTE 08
#define VERSION_DATE_DAY 11
#define VERSION_DATE_HOUR 10
#define VERSION_DATE_MINUTE 46
// this is NOT the version hash !!
// it's the last version hash
@@ -924,28 +924,45 @@ static void update_ZM_instruction(uint8 *ins) {
break;
}
case CURVE_CALI_ADC: {
case CURVE_CALI: {
switch(ins[3]) {
case RIS_ADC_IIN : { // 0x00
instru.eliteFxn = CURVE_CALI_ADC;
instru.eliteFxn = CURVE_CALI;
instru.AdcChannel = RIS_ADC_IIN;
instru.notifyRate = 1000;
ModeLED(WORKING);
break;
}
case RIS_ADC_VIN : { // 0x01
instru.eliteFxn = CURVE_CALI_ADC;
instru.eliteFxn = CURVE_CALI;
instru.AdcChannel = RIS_ADC_VIN;
instru.notifyRate = 1000;
ModeLED(WORKING);
break;
}
case RIS_DAC_VOUT : { // 0x02
instru.eliteFxn = CURVE_CALI_ADC;
instru.eliteFxn = CURVE_CALI;
instru.AdcChannel = RIS_DAC_VOUT;
instru.notifyRate = 1000;
instru.VoltConstant = ( ((uint16_t)(ins[4])) << 8) | (uint16_t)(ins[5]); // output voltage
switch(ins[4]) {
case 0x00: {
instru.VoltConstant = 0x2710;
break;
}
case 0x01: {
instru.VoltConstant = 0x61A8;
break;
}
case 0x02: {
instru.VoltConstant = 0xC350;
break;
}
case 0x03: {
instru.VoltConstant = 0xEA60;
break;
}
}
ModeLED(WORKING);
break;
}
@@ -86,7 +86,7 @@ static void ZM_init() {
(instru.eliteFxn == CURVE_CA) || \
(instru.eliteFxn == CURVE_VO) || \
(instru.eliteFxn == CURVE_OCP) || \
(instru.eliteFxn == CURVE_CALI_ADC) \
(instru.eliteFxn == CURVE_CALI) \
)
#define Ve1MatchVe2Mode() ( \
@@ -151,7 +151,7 @@ static void peri_mode(void)
(instru.eliteFxn == CURVE_DPV_SMPRATE) ||
(instru.eliteFxn == CURVE_DPV_ADVANCE) ||
(instru.eliteFxn == CURVE_DPV_ADVANCE_SMPRATE) ||
(instru.eliteFxn == CURVE_CALI_ADC)) {
(instru.eliteFxn == CURVE_CALI)) {
batteryCheck_flag = false;
tempCheck_flag = false;
@@ -255,7 +255,7 @@ static void uni_pulse_mode(void)
(instru.eliteFxn == CURVE_DPV_SMPRATE) ||
(instru.eliteFxn == CURVE_DPV_ADVANCE) ||
(instru.eliteFxn == CURVE_DPV_ADVANCE_SMPRATE) ||
(instru.eliteFxn == CURVE_CALI_ADC)) {
(instru.eliteFxn == CURVE_CALI)) {
batteryCheck_flag = false;
tempCheck_flag = false;
@@ -352,7 +352,7 @@ static void mode_init_set(void)
IinADCGainCtrl(instru.IinADCGainLv);
VoutGainControl(instru.VoutGainLv);
// if(instru.eliteFxn == CURVE_CALI_ADC) {
// if(instru.eliteFxn == CURVE_CALI) {
// volt_rec_en = true;
// curr_rec_en = true;
// }
@@ -560,7 +560,7 @@ static void EliteADCControl(uint32_t time)
}
break;
case CURVE_CALI_ADC:
case CURVE_CALI:
if (instru.AdcChannel == RIS_ADC_IIN) {
cali_IT_plot();
@@ -622,7 +622,7 @@ static void mode_done(void)
(instru.eliteFxn == CURVE_DPV_SMPRATE) ||
(instru.eliteFxn == CURVE_DPV_ADVANCE) ||
(instru.eliteFxn == CURVE_DPV_ADVANCE_SMPRATE) ||
(instru.eliteFxn == CURVE_CALI_ADC))
(instru.eliteFxn == CURVE_CALI))
{
if (!PeriodicEvent) {
finishMode = true;