Add parameter from UI.

This commit is contained in:
Benny Liu
2021-06-28 17:10:18 +08:00
parent 43d2623eb2
commit d44843d525
2 changed files with 14 additions and 1 deletions
@@ -181,6 +181,9 @@ static int __it_create(void)
m->_measureBat = 0;
m->_VoViSwitch = instru.VoViSwitch;
p->_Vinit = (instru.Vinit - 25000) * 4 * 10000; //[5nV]
p->_Vset = 0;
*wm = p;
return 0;
@@ -756,7 +756,8 @@ static void update_ZM_instruction(uint8 *ins) {
instru.notifyRate = 10000 / instru.notifyRate * 10;
instru.sampleRate = 15;
instru.VsetRate = 2;
instru.Ve1 = 25000 + 5000; // Vout = 0.1 V at RT mode
// instru.Ve1 = 25000 + 5000; // Vout = 0.1 V at RT mode
instru.Ve1 = ((uint16_t)ins[3] << 8) | (uint16_t)ins[4];
instru.Vinit = (int32_t)instru.Ve1;
// TODO: input to json
@@ -803,6 +804,15 @@ static void update_ZM_instruction(uint8 *ins) {
instru.notifyRate = ((uint32_t)ins[3] << 8) | (uint32_t)ins[4];
instru.notifyRate = 10000 / instru.notifyRate * 10;
instru.sampleRate = 15;
instru.Ve1 = ((uint16_t)ins[3] << 8) | (uint16_t)ins[4];
instru.Vinit = (int32_t)instru.Ve1;
if(instru.Ve1 < DAC_VOUT_GAIN_LARGE_BOUNDARY_USERCODE && instru.Ve1 > DAC_VOUT_GAIN_LARGE_BOUNDARY1_USERCODE){
instru.VoutGainLevel = VOUT_GAIN_15K;
} else {
instru.VoutGainLevel = VOUT_GAIN_240K;
}
ModeLED(WORKING);
break;
}