work touch menu operation

This commit is contained in:
TT 2016-12-17 18:32:27 +09:00
parent 8038df8c66
commit 0bf87f42aa
4 changed files with 261 additions and 139 deletions

5
adc.c
View file

@ -54,7 +54,7 @@ void adc_start_analog_watchdogd(ADC_TypeDef *adc, uint32_t chsel)
is enabled.*/
adc->ISR = adc->ISR;
adc->IER = ADC_IER_AWDIE;
adc->TR = ADC_TR(0, 2000);
adc->TR = ADC_TR(0, TOUCH_THRESHOLD);
adc->SMPR = ADC_SMPR_SMP_1P5;
adc->CHSELR = chsel;
@ -92,8 +92,7 @@ void adc_interrupt(ADC_TypeDef *adc)
}
if (isr & ADC_ISR_AWD) {
/* Analog watchdog error.*/
extern int awd_count;
awd_count++;
handle_touch_interrupt();
}
}