在Touch_Key_with_ble例程里,改成4個(gè)觸摸通道,只要執(zhí)行ADC轉(zhuǎn)換就無(wú)法使用觸摸功能,還請(qǐng)解答一下如和兼容adc功能與觸摸功能?
Touch_Key_with_ble例程改動(dòng)如下:
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,
實(shí)際測(cè)試,在touch_ScanEnterSleep之前,touch都能正常工作,一旦執(zhí)行ADC轉(zhuǎn)換就無(wú)法觸摸。
peripherals_EnterSleep中進(jìn)行ADC轉(zhuǎn)換之前在touch_ScanEnterSleep中已經(jīng)執(zhí)行了TKY_SaveAndStop();應(yīng)該不會(huì)出現(xiàn)沖突才對(duì)啊,請(qǐng)問(wèn)如何兼容ADC與touch事件呢?