mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-12-29 02:40:41 -07:00
🚸 More frequent button polling (#27797)
This commit is contained in:
parent
1d4c002c2a
commit
1242e875aa
3 changed files with 14 additions and 3 deletions
|
|
@ -2268,6 +2268,8 @@
|
|||
#define ADC_BUTTON_DEBOUNCE_DELAY 16 // (count) Increase if buttons bounce or repeat too fast
|
||||
#endif
|
||||
|
||||
//#define FAST_BUTTON_POLLING // Poll buttons at ~1kHz on 8-bit AVR. Set to 'false' for slow polling on 32-bit.
|
||||
|
||||
// @section safety
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3557,6 +3557,10 @@
|
|||
#define HAS_ROTARY_ENCODER 1
|
||||
#endif
|
||||
|
||||
#if defined(CPU_32_BIT) && !defined(FAST_BUTTON_POLLING)
|
||||
#define FAST_BUTTON_POLLING
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(SAFE_POWER) && DISABLED(DISABLE_DRIVER_SAFE_POWER_PROTECT)
|
||||
#define HAS_DRIVER_SAFE_POWER_PROTECT 1
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4283,10 +4283,15 @@ void Temperature::isr() {
|
|||
#endif // SLOW_PWM_HEATERS
|
||||
|
||||
//
|
||||
// Update lcd buttons 488 times per second
|
||||
// Update lcd buttons at ~488Hz or ~976Hz
|
||||
//
|
||||
static bool do_buttons;
|
||||
if ((do_buttons ^= true)) ui.update_buttons();
|
||||
#if ENABLED(FAST_BUTTON_POLLING)
|
||||
constexpr bool do_buttons = true;
|
||||
#else
|
||||
static bool do_buttons;
|
||||
do_buttons ^= true;
|
||||
#endif
|
||||
if (do_buttons) ui.update_buttons();
|
||||
|
||||
/**
|
||||
* One sensor is sampled on every other call of the ISR.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue