|
|
|
@ -2712,11 +2712,14 @@ void Temperature::tick() {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if HAS_ADC_BUTTONS
|
|
|
|
|
#ifndef ADC_BUTTON_DEBOUNCE_DELAY
|
|
|
|
|
#define ADC_BUTTON_DEBOUNCE_DELAY 16
|
|
|
|
|
#endif
|
|
|
|
|
case Prepare_ADC_KEY: HAL_START_ADC(ADC_KEYPAD_PIN); break;
|
|
|
|
|
case Measure_ADC_KEY:
|
|
|
|
|
if (!HAL_ADC_READY())
|
|
|
|
|
next_sensor_state = adc_sensor_state; // redo this state
|
|
|
|
|
else if (ADCKey_count < 16) {
|
|
|
|
|
else if (ADCKey_count < ADC_BUTTON_DEBOUNCE_DELAY) {
|
|
|
|
|
raw_ADCKey_value = HAL_READ_ADC();
|
|
|
|
|
if (raw_ADCKey_value <= 900UL * HAL_ADC_RANGE / 1024UL) {
|
|
|
|
|
NOMORE(current_ADCKey_raw, raw_ADCKey_value);
|
|
|
|
@ -2730,9 +2733,9 @@ void Temperature::tick() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (ADCKey_count == 16) ADCKey_pressed = true;
|
|
|
|
|
if (ADCKey_count == ADC_BUTTON_DEBOUNCE_DELAY) ADCKey_pressed = true;
|
|
|
|
|
break;
|
|
|
|
|
#endif // ADC_KEYPAD
|
|
|
|
|
#endif // HAS_ADC_BUTTONS
|
|
|
|
|
|
|
|
|
|
case StartupDelay: break;
|
|
|
|
|
|
|
|
|
|