|
@@ -2712,11 +2712,14 @@ void Temperature::tick() {
|
2712
|
2712
|
#endif
|
2713
|
2713
|
|
2714
|
2714
|
#if HAS_ADC_BUTTONS
|
|
2715
|
+ #ifndef ADC_BUTTON_DEBOUNCE_DELAY
|
|
2716
|
+ #define ADC_BUTTON_DEBOUNCE_DELAY 16
|
|
2717
|
+ #endif
|
2715
|
2718
|
case Prepare_ADC_KEY: HAL_START_ADC(ADC_KEYPAD_PIN); break;
|
2716
|
2719
|
case Measure_ADC_KEY:
|
2717
|
2720
|
if (!HAL_ADC_READY())
|
2718
|
2721
|
next_sensor_state = adc_sensor_state; // redo this state
|
2719
|
|
- else if (ADCKey_count < 16) {
|
|
2722
|
+ else if (ADCKey_count < ADC_BUTTON_DEBOUNCE_DELAY) {
|
2720
|
2723
|
raw_ADCKey_value = HAL_READ_ADC();
|
2721
|
2724
|
if (raw_ADCKey_value <= 900UL * HAL_ADC_RANGE / 1024UL) {
|
2722
|
2725
|
NOMORE(current_ADCKey_raw, raw_ADCKey_value);
|
|
@@ -2730,9 +2733,9 @@ void Temperature::tick() {
|
2730
|
2733
|
}
|
2731
|
2734
|
}
|
2732
|
2735
|
}
|
2733
|
|
- if (ADCKey_count == 16) ADCKey_pressed = true;
|
|
2736
|
+ if (ADCKey_count == ADC_BUTTON_DEBOUNCE_DELAY) ADCKey_pressed = true;
|
2734
|
2737
|
break;
|
2735
|
|
- #endif // ADC_KEYPAD
|
|
2738
|
+ #endif // HAS_ADC_BUTTONS
|
2736
|
2739
|
|
2737
|
2740
|
case StartupDelay: break;
|
2738
|
2741
|
|