diff options
Diffstat (limited to 'apps/plugins/resistor.c')
-rw-r--r-- | apps/plugins/resistor.c | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/apps/plugins/resistor.c b/apps/plugins/resistor.c index ec6a364f23..2e204010a9 100644 --- a/apps/plugins/resistor.c +++ b/apps/plugins/resistor.c @@ -566,15 +566,17 @@ static void display_helpfile(void) { 159, TEXT_UNDERLINE }, LAST_STYLE_ITEM }; - + display_text(ARRAYLEN(helpfile_text), helpfile_text, formatting, NULL, true); return; } - + static void led_resistance_calc(void) { +#ifdef HAVE_BACKLIGHT backlight_ignore_timeout(); +#endif int voltage_menu_selection, button_press, j, k, l, foreward_current = 0; int fwd_current_selection = 0; bool quit = false; @@ -759,14 +761,17 @@ static void led_resistance_calc(void) rb->lcd_puts_scroll(resistance_val_x, lineno++, power_rating_out_str); rb->lcd_update(); - + while ((button_press = rb->button_get(true)) & BUTTON_REL); switch(button_press) { case PLA_SELECT: break; default: quit = true; + +#ifdef HAVE_BACKLIGHT backlight_use_settings(); +#endif break; } } @@ -776,10 +781,12 @@ static void led_resistance_calc(void) rb->lcd_clear_display(); } - -static void resistance_to_color(void) + +static void resistance_to_color(void) { +#ifdef HAVE_BACKLIGHT backlight_ignore_timeout(); +#endif int menu_selection; int menu_selection_tol; int button_press; @@ -883,27 +890,29 @@ static void resistance_to_color(void) in_resistance_int,band_data[units_used].unit); return; } - + rb->lcd_clear_display(); lineno = INITIAL_TEXT_Y; #ifndef USE_TEXT_ONLY draw_resistor(first_band, second_band, multiplier, fourth_band); -#endif +#endif draw_resistor_text(first_band, second_band, multiplier, fourth_band); - + rb->snprintf(out_str, sizeof(out_str), "Input: %d %s", in_resistance_int, band_data[units_used].unit); display->set_viewport(&text_vp); rb->lcd_puts_scroll(r_to_c_out_str_x, lineno++, out_str); rb->lcd_update(); - + button_press = rb->button_get(true); switch(button_press) { case PLA_SELECT: break; default: quit = true; +#ifdef HAVE_BACKLIGHT backlight_use_settings(); +#endif break; } } @@ -912,25 +921,27 @@ static void resistance_to_color(void) display->set_viewport(&screen_vp); rb->lcd_clear_display(); } - -static void color_to_resistance(void) + +static void color_to_resistance(void) { +#ifdef HAVE_BACKLIGHT backlight_ignore_timeout(); +#endif bool quit = false; int button_input = 0; - + /* The colors of the bands */ enum color first_band = 0; enum color second_band = 0; enum color third_band = 0; enum color fourth_band = 0; - + int total_resistance_centiunits = 0; char total_resistance_str [35]; - + rb->splash(HZ/2, "Colour to resistance"); rb->lcd_clear_display(); - + while(!quit) { first_band = do_first_band_menu(); if(first_band==RES_INVALID) break; @@ -984,9 +995,11 @@ static void color_to_resistance(void) case PLA_SELECT: default: quit = true; +#ifdef HAVE_BACKLIGHT backlight_use_settings(); +#endif break; - } + } } display->set_viewport(&text_vp); rb->lcd_scroll_stop(); |