optimisation: reduce code size in rendering cursor
Change in memory: Flash: -62 bytes SRAM: 0 bytes
This commit is contained in:
parent
c51aa10087
commit
504099bd6c
|
|
@ -171,18 +171,14 @@ static uint8_t ReportErrorHookMonitor(uint8_t ei) {
|
||||||
//! ----------------------
|
//! ----------------------
|
||||||
//! @endcode
|
//! @endcode
|
||||||
//
|
//
|
||||||
lcd_set_cursor(0, 3);
|
lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' ');
|
||||||
lcd_print(current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' ');
|
|
||||||
if (two_choices == false)
|
if (two_choices == false)
|
||||||
{
|
{
|
||||||
lcd_set_cursor(9, 3);
|
lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' ');
|
||||||
lcd_print(current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' ');
|
lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' ');
|
||||||
lcd_set_cursor(18, 3);
|
|
||||||
lcd_print(current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' ');
|
|
||||||
} else {
|
} else {
|
||||||
// More button for two button screen
|
// More button for two button screen
|
||||||
lcd_set_cursor(18, 3);
|
lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' ');
|
||||||
lcd_print(current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' ');
|
|
||||||
}
|
}
|
||||||
// Consume rotation event and make feedback sound
|
// Consume rotation event and make feedback sound
|
||||||
enc_dif = lcd_encoder_diff;
|
enc_dif = lcd_encoder_diff;
|
||||||
|
|
|
||||||
|
|
@ -3089,16 +3089,12 @@ uint8_t lcd_show_multiscreen_message_yes_no_and_wait_P(const char *msg, bool all
|
||||||
//! @param third_choice text caption of third, optional, choice.
|
//! @param third_choice text caption of third, optional, choice.
|
||||||
void lcd_show_choices_prompt_P(uint8_t selected, const char *first_choice, const char *second_choice, uint8_t second_col, const char *third_choice)
|
void lcd_show_choices_prompt_P(uint8_t selected, const char *first_choice, const char *second_choice, uint8_t second_col, const char *third_choice)
|
||||||
{
|
{
|
||||||
lcd_set_cursor(0, 3);
|
lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' ');
|
||||||
lcd_print(selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' ');
|
|
||||||
lcd_puts_P(first_choice);
|
lcd_puts_P(first_choice);
|
||||||
lcd_set_cursor(second_col, 3);
|
lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' ');
|
||||||
lcd_print(selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' ');
|
|
||||||
lcd_puts_P(second_choice);
|
lcd_puts_P(second_choice);
|
||||||
if (third_choice)
|
if (third_choice) {
|
||||||
{
|
lcd_putc_at(18, 3, selected == LCD_RIGHT_BUTTON_CHOICE ? '>': ' ');
|
||||||
lcd_set_cursor(18, 3);
|
|
||||||
lcd_print(selected == LCD_RIGHT_BUTTON_CHOICE ? '>': ' ');
|
|
||||||
lcd_puts_P(third_choice);
|
lcd_puts_P(third_choice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue