`lcd_buttons` is actually `lcd_click_trigger`
Flash: -4B SRAM: 0B
This commit is contained in:
parent
eb8ac250cc
commit
ea101f49d4
|
|
@ -635,7 +635,7 @@ uint8_t lcd_draw_update = 2;
|
||||||
int16_t lcd_encoder = 0;
|
int16_t lcd_encoder = 0;
|
||||||
static int8_t lcd_encoder_diff = 0;
|
static int8_t lcd_encoder_diff = 0;
|
||||||
|
|
||||||
uint8_t lcd_buttons = 0;
|
uint8_t lcd_click_trigger = 0;
|
||||||
uint8_t lcd_update_enabled = 1;
|
uint8_t lcd_update_enabled = 1;
|
||||||
static bool lcd_backlight_wake_trigger; // Flag set by interrupt when the knob is pressed or rotated
|
static bool lcd_backlight_wake_trigger; // Flag set by interrupt when the knob is pressed or rotated
|
||||||
|
|
||||||
|
|
@ -776,7 +776,7 @@ void lcd_buttons_update(void)
|
||||||
lcd_button_pressed = 0; // Reset to prevent double triggering
|
lcd_button_pressed = 0; // Reset to prevent double triggering
|
||||||
if (!lcd_long_press_active)
|
if (!lcd_long_press_active)
|
||||||
{ //button released before long press gets activated
|
{ //button released before long press gets activated
|
||||||
lcd_buttons |= EN_C; // This flag is reset when the event is consumed
|
lcd_click_trigger = 1; // This flag is reset when the event is consumed
|
||||||
}
|
}
|
||||||
lcd_backlight_wake_trigger = true; // flag event, knob pressed
|
lcd_backlight_wake_trigger = true; // flag event, knob pressed
|
||||||
lcd_long_press_active = 0;
|
lcd_long_press_active = 0;
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,7 @@ extern uint8_t lcd_draw_update;
|
||||||
|
|
||||||
extern int16_t lcd_encoder;
|
extern int16_t lcd_encoder;
|
||||||
|
|
||||||
//the last checked lcd_buttons in a bit array.
|
extern uint8_t lcd_click_trigger;
|
||||||
extern uint8_t lcd_buttons;
|
|
||||||
|
|
||||||
extern uint8_t lcd_update_enabled;
|
extern uint8_t lcd_update_enabled;
|
||||||
|
|
||||||
|
|
@ -156,20 +155,7 @@ private:
|
||||||
bool m_updateEnabled;
|
bool m_updateEnabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
// Setup button and encode mappings for each panel (into 'lcd_buttons' variable
|
|
||||||
//
|
|
||||||
// This is just to map common functions (across different panels) onto the same
|
|
||||||
// macro name. The mapping is independent of whether the button is directly connected or
|
|
||||||
// via a shift/i2c register.
|
|
||||||
|
|
||||||
#define BLEN_B 1
|
|
||||||
#define BLEN_A 0
|
|
||||||
#define EN_B (1<<BLEN_B) // The two encoder pins are connected through BTN_EN1 and BTN_EN2
|
|
||||||
#define EN_A (1<<BLEN_A)
|
|
||||||
#define BLEN_C 2
|
|
||||||
#define EN_C (1<<BLEN_C)
|
|
||||||
|
|
||||||
//! @brief Was button clicked?
|
//! @brief Was button clicked?
|
||||||
//!
|
//!
|
||||||
|
|
@ -180,9 +166,8 @@ private:
|
||||||
//!
|
//!
|
||||||
//! @retval 0 button was not clicked
|
//! @retval 0 button was not clicked
|
||||||
//! @retval 1 button was clicked
|
//! @retval 1 button was clicked
|
||||||
#define LCD_CLICKED (lcd_buttons&EN_C)
|
#define LCD_CLICKED (lcd_click_trigger)
|
||||||
|
|
||||||
////////////////////////
|
|
||||||
// Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
|
// Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
|
||||||
// These values are independent of which pins are used for EN_A and EN_B indications
|
// These values are independent of which pins are used for EN_A and EN_B indications
|
||||||
// The rotary encoder part is also independent to the chipset used for the LCD
|
// The rotary encoder part is also independent to the chipset used for the LCD
|
||||||
|
|
@ -191,6 +176,7 @@ private:
|
||||||
#define encrot2 3
|
#define encrot2 3
|
||||||
#define encrot3 1
|
#define encrot3 1
|
||||||
|
|
||||||
|
////////////////////////////////////
|
||||||
|
|
||||||
//Custom characters defined in the first 8 characters of the LCD
|
//Custom characters defined in the first 8 characters of the LCD
|
||||||
#define LCD_STR_BEDTEMP "\x00"
|
#define LCD_STR_BEDTEMP "\x00"
|
||||||
|
|
@ -212,7 +198,7 @@ extern void lcd_set_custom_characters_nextpage(void);
|
||||||
//! @brief Consume click and longpress event
|
//! @brief Consume click and longpress event
|
||||||
inline void lcd_consume_click()
|
inline void lcd_consume_click()
|
||||||
{
|
{
|
||||||
lcd_buttons = 0;
|
lcd_click_trigger = 0;
|
||||||
lcd_longpress_trigger = 0;
|
lcd_longpress_trigger = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue