在Touch_Key_with_ble例程里,改成4个触摸通道,只要执行ADC转换就无法使用触摸功能,还请解答一下如和兼容adc功能与触摸功能?
Touch_Key_with_ble例程改动如下:
app_tmos.c
static?void?peripherals_EnterSleep(void) { ????/*You?code?here*/ ????GPIOA_ModeCfg(GPIO_Pin_12,?GPIO_ModeIN_Floating); ????ADC_ExtSingleChSampInit(?SampleFreq_3_2,?ADC_PGA_0?); ????ADC_ChannelCfg(?CH_EXTIN_2?); ????printf("adc_value:%d\n",ADC_ExcutSingleConver()); }
部分串口打印输出如下:
0008,0022,0003,0010, 3522,3237,3289,3304, 3479,3217,3297,3350, 0007,0016,0002,0010, 3522,3237,3289,3304, 3539,3183,3298,3272, Ready?to?sleep adc_value:4 0009,0016,0001,0007, 3522,3237,3289,3304, 3503,3269,3302,3317, wake?up... wake?up?for?a?while 0164,0105,0106,0114, 3521,3236,3288,3303, 2829,2829,2829,2829, 0690,0406,0457,0472, 3521,3236,3288,3303, 2829,2829,2829,2829, 0689,0404,0456,0471, 3521,3236,3288,3303, 2832,2832,2832,2832,
实际测试,在touch_ScanEnterSleep之前,touch都能正常工作,一旦执行ADC转换就无法触摸。
peripherals_EnterSleep中进行ADC转换之前在touch_ScanEnterSleep中已经执行了TKY_SaveAndStop();应该不会出现冲突才对啊,请问如何兼容ADC与touch事件呢?