ESP8266 NMI定时中断的时间被系统SDK后台程序影响

Buyer
Posts: 2
Joined: Thu Apr 26, 2018 7:40 pm

ESP8266 NMI定时中断的时间被系统SDK后台程序影响

Postby Buyer » Mon May 07, 2018 10:18 am

我们现在用NMI中断做一个信号,但发现在后台运行时,中断发生的频率会不准,似乎是被系统后台其它任务影响了。
请问具体应该怎么改?才能让NMI成为最高优先级?

void ICACHE_FLASH_ATTR myt_init(void)
{
#define NMI_SOURCE_SEL_REG 0x3ff00000
WRITE_PERI_REG(NMI_SOURCE_SEL_REG, (READ_PERI_REG(NMI_SOURCE_SEL_REG)&~0x1F)|(0x1+0x7*2) );

NmiTimSetFunc(mytpwm_tim1_intr_handler);

RTC_REG_WRITE(FRC1_CTRL_ADDRESS, FRC1_CTRL_DIV_V | FRC1_ENABLE_TIMER | TM_EDGE_INT);

RTC_REG_WRITE(FRC1_LOAD_ADDRESS, FRC1_TOTAL_LOADV);

TM1_EDGE_INT_ENABLE();
ETS_FRC1_INTR_ENABLE();

}


Who is online

Users browsing this forum: No registered users and 17 guests