optimisation: combine if statements in Sensors menu

FINDA status is always 0 or 1

Change in memory:
Flash: -28 bytes
SRAM: 0 bytes
This commit is contained in:
Guðni Már Gilbert 2023-04-09 13:51:28 +00:00
parent 7ff514621c
commit 00ffab8f62
1 changed files with 2 additions and 7 deletions

View File

@ -3297,20 +3297,15 @@ static void lcd_show_sensors_state()
{
//0: N/A; 1: OFF; 2: ON
uint8_t pinda_state = STATE_NA;
uint8_t finda_state = STATE_NA;
uint8_t idler_state = STATE_NA;
pinda_state = READ(Z_MIN_PIN);
if (MMU2::mmu2.Enabled())
{
finda_state = MMU2::mmu2.FindaDetectsFilament();
}
lcd_puts_at_P(0, 0, MSG_PINDA);
lcd_set_cursor(LCD_WIDTH - 14, 0);
lcd_print_state(pinda_state);
if (MMU2::mmu2.Enabled())
{
if (MMU2::mmu2.Enabled()) {
const uint8_t finda_state = MMU2::mmu2.FindaDetectsFilament();
lcd_puts_at_P(10, 0, _n("FINDA"));////MSG_FINDA c=5
lcd_set_cursor(LCD_WIDTH - 3, 0);
lcd_print_state(finda_state);