Compare commits

...

2 Commits

Author SHA1 Message Date
Benny Liu 63310bdd03 cali_count_max = 5000 for smallest Vin and Iin gain 2020-12-17 12:38:38 +08:00
Benny Liu 1954ff8d9e Add calibration count from 1000 to 5000. 2020-12-03 14:36:31 +08:00
2 changed files with 10 additions and 7 deletions
@@ -624,7 +624,7 @@ static void cali_IT_plot(WorkMode *WorkModeData) {
}
}else{
static uint16_t cali_count = 0;
if(cali_count >= 1000){
if(cali_count >= 5000){
ADCValueAVG = ADCValueSUM / cali_count;
InputNotify(NOTIFY_CURRENT, ADCValueAVG);
@@ -642,12 +642,13 @@ static void cali_IT_plot(WorkMode *WorkModeData) {
PeriodicEvent = false;
ModeLED(NO_EVENT);
}else{
cali_count++;
ADCValueSUM = ADCValueSUM + CURRENT_MODE->_measureCurrent;
InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
InputNotify(NOTIFY_VOLT, ADCValueSUM);
InputNotify(NOTIFY_IMPEDANCE, (int32_t)cali_count);
// InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
// InputNotify(NOTIFY_VOLT, ADCValueSUM);
// InputNotify(NOTIFY_IMPEDANCE, (int32_t)cali_count);
}
}
@@ -618,11 +618,13 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
if (!PeriodicEvent) { // if there is no periodic event
key = PIN_getInputValue(switch_on);
if (EliteOn) {
if (counter6994 < CLOCK_ONE_SECOND/2) { // counter6994 enable a IC after 35 counts
if (counter6994 < CLOCK_ONE_SECOND*5) { // counter6994 enable a IC after 35 counts
counter6994++;
} else if (counter6994 == CLOCK_ONE_SECOND/2) {
PIN15_setOutputValue(shutdown_6994, 1); // OFF = 1 => turn off 6994
} else if (counter6994 == CLOCK_ONE_SECOND*5) {
PIN15_setOutputValue(shutdown_6994, 0); // OFF = 1 => turn off 6994
counter6994++;
} else if (counter6994 > CLOCK_ONE_SECOND*5) {
counter6994 = 0;
}
EliteKeyPress(key);