Page 1 of 1

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

Posted: Mon May 07, 2018 10:18 am
by Buyer
我们现在用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();

}

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

Posted: Thu May 10, 2018 10:36 am
by Her Mary