//------------------------------------------------------------------- static void gui_read_draw_batt() { unsigned long v; v = get_batt_average(); sprintf(buffer, "%ld.%03ld V", v/1000, v%1000); draw_txt_string(screen_width/FONT_WIDTH-2-1-1-9, 0, buffer, MAKE_COLOR(conf.reader_color>>8, (v<2100)?COLOR_RED:conf.reader_color)); }
//------------------------------------------------------------------- static void gui_batt_draw_volts() { unsigned long v; v = get_batt_average(); sprintf(osd_buf, "%ld.%03ld", v/1000, v%1000); osd_buf[5]=0; draw_string(conf.batt_txt_pos.x, conf.batt_txt_pos.y, osd_buf, conf.osd_color); }
//------------------------------------------------------------------- unsigned long get_batt_perc() { unsigned long v; v = get_batt_average(); if (v>conf.batt_volts_max) v=conf.batt_volts_max; if (v<conf.batt_volts_min) v=conf.batt_volts_min; return (v-conf.batt_volts_min)*100/(conf.batt_volts_max-conf.batt_volts_min); }