Skip to content

Commit

Permalink
Allow larger ADC debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and Alexander Yasnogor committed Aug 7, 2020
1 parent 53629aa commit 6fb9af3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@
// ADC Button Debounce
//
#if HAS_ADC_BUTTONS
#define ADC_BUTTON_DEBOUNCE_DELAY 16 // (ms) Increase if buttons bounce or repeat too fast
#define ADC_BUTTON_DEBOUNCE_DELAY 16 // Increase if buttons bounce or repeat too fast
#endif

// @section safety
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -2976,8 +2976,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#endif
#endif

#if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && !WITHIN(ADC_BUTTON_DEBOUNCE_DELAY, 16, 255)
#error "ADC_BUTTON_DEBOUNCE_DELAY must be an integer from 16 to 255."
#if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && ADC_BUTTON_DEBOUNCE_DELAY < 16
#error "ADC_BUTTON_DEBOUNCE_DELAY must be greater than 16."
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ volatile bool Temperature::raw_temps_ready = false;

#if HAS_ADC_BUTTONS
uint32_t Temperature::current_ADCKey_raw = HAL_ADC_RANGE;
uint8_t Temperature::ADCKey_count = 0;
uint16_t Temperature::ADCKey_count = 0;
#endif

#if ENABLED(PID_EXTRUSION_SCALING)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/temperature.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ class Temperature {
public:
#if HAS_ADC_BUTTONS
static uint32_t current_ADCKey_raw;
static uint8_t ADCKey_count;
static uint16_t ADCKey_count;
#endif

TERN_(PID_EXTRUSION_SCALING, static int16_t lpq_len);
Expand Down
7 changes: 7 additions & 0 deletions Marlin/src/pins/ramps/pins_ZRIB_V20.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@
#undef ADC_KEYPAD_PIN
#undef BEEPER_PIN

#undef SHIFT_OUT
#undef SHIFT_CLK
#undef SHIFT_LD
#undef BTN_EN1
#undef BTN_EN2
#undef BTN_ENC

#define LCD_PINS_RS ZRIB_V20_D16_PIN
#define LCD_PINS_ENABLE ZRIB_V20_D17_PIN
#define LCD_PINS_D4 ZRIB_V20_D23_PIN
Expand Down

0 comments on commit 6fb9af3

Please sign in to comment.