/* ****************************************************************** */ void show_C_ESR() { uint8_t key_pressed; message_key_released(C_ESR_str); #ifdef POWER_OFF uint8_t times; for (times=0;times<250;times++) #else while (1) /* wait endless without the POWER_OFF option */ #endif { PartFound = PART_NONE; ReadBigCap(TP3,TP1); if (PartFound == PART_CAPACITOR) { lcd_line1(); // clear old capacity value lcd_clear_line(); lcd_line1(); lcd_data('C'); lcd_data('='); DisplayValue(cap.cval_max,cap.cpre_max,'F',3); cap.esr = GetESR(cap.cb,cap.ca); lcd_line2(); // clear old ESR value lcd_clear_line(); lcd_line2(); lcd_MEM_string(&ESR_str[1]); if (cap.esr < 65530) { DisplayValue(cap.esr,-2,LCD_CHAR_OMEGA,2); } else { lcd_data('?'); // too big } } else { lcd_clear(); lcd_MEM2_string(C_ESR_str); } key_pressed = wait_for_key_ms(1000); #ifdef WITH_ROTARY_SWITCH if ((key_pressed != 0) || (rotary.incre > 3)) break; #else if (key_pressed != 0) break; #endif } /* end for times */ } /* end show_C_ESR() */
/* ****************************************************************** */ void show_C_ESR() { uint8_t key_pressed; message_key_released(C_ESR_str); #ifdef POWER_OFF uint8_t times; for (times=0;times<250;) #else while (1) /* wait endless without the POWER_OFF option */ #endif { PartFound = PART_NONE; ReadBigCap(TP3,TP1); if (PartFound == PART_CAPACITOR) { #if LCD_LINES > 2 lcd_line2(); // set to line2 #else lcd_line1(); // set to line1 #endif lcd_data('C'); lcd_equal(); // lcd_data('='); DisplayValue(cap.cval_max,cap.cpre_max,'F',3); lcd_clear_line(); // clear to end of line 1 cap.esr = GetESR(cap.cb,cap.ca); #if LCD_LINES > 2 lcd_line3(); // use line 3 #else lcd_line2(); // use line 2 #endif lcd_MEM_string(&ESR_str[1]); if (cap.esr < 65530) { DisplayValue16(cap.esr,-2,LCD_CHAR_OMEGA,2); } else { lcd_data('?'); // too big } lcd_clear_line(); // clear to end of line } else { // no cap found #if LCD_LINES > 2 lcd_clear_line2(); // clear C value lcd_line3(); lcd_clear_line(); // clear old ESR value #else lcd_line1(); // lcd_MEM2_string(C_ESR_str); lcd_clear_line(); lcd_clear_line2(); // clear old ESR value #endif } #if defined(POWER_OFF) && defined(BAT_CHECK) Bat_update(times); #endif key_pressed = wait_for_key_ms(1000); #ifdef WITH_ROTARY_SWITCH if ((key_pressed != 0) || (rotary.incre > 3)) break; #else if (key_pressed != 0) break; #endif #ifdef POWER_OFF times = Pwr_mode_check(times); // no time limit with DC_Pwr_mode #endif } /* end for times */ } /* end show_C_ESR() */