CH582M使用ADC轉(zhuǎn)換導(dǎo)致觸摸功能失效

在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事件呢?

使用EVT的例程,采集數(shù)據(jù)的時(shí)候配置初始化ADC即可。

使用睡眠功能,直接開(kāi)啟HAL_SLEEP。


睡眠功能不用管,我的意思是在PeriodicDealData觸摸休眠狀態(tài)處理時(shí)當(dāng)喚醒態(tài)轉(zhuǎn)休眠時(shí)會(huì)執(zhí)行peripherals_EnterSleep,此時(shí)在peripherals_EnterSleep函數(shù)內(nèi)執(zhí)行ADC轉(zhuǎn)換會(huì)造成觸摸功能失效。

peripherals_EnterSleep里采集ADC數(shù)據(jù),如果只配置初始化ADC ,那么如何得到ADC轉(zhuǎn)換的數(shù)據(jù)呢?


只有登錄才能回復(fù),可以選擇微信賬號(hào)登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频