- portENTER_CRITICAL(&delay_spinlock);
- portEXIT_CRITICAL(&delay_spinlock);
如何彻底关闭中断
Re: 如何彻底关闭中断
These 2 macros disable interrupts up to and including level 3. Interrupts level 4 and 5 are still allowed in FreeRTOS critical sections. In practice, you may find that disabling interrupts up to level 4 will give the result you need. Note however that your timing requirements come from some bitbanging procedure, it may be better to use one of the ESP32's peripherals (RMT, I2S) instead.
Re: 如何彻底关闭中断
Thanks for reply.ESP_igrr wrote: ↑Tue Aug 06, 2019 7:01 amThese 2 macros disable interrupts up to and including level 3. Interrupts level 4 and 5 are still allowed in FreeRTOS critical sections. In practice, you may find that disabling interrupts up to level 4 will give the result you need. Note however that your timing requirements come from some bitbanging procedure, it may be better to use one of the ESP32's peripherals (RMT, I2S) instead.
Yeah, my timing requirements come from a custom protocal, it's not suitable for stantard peripherals , like I2C etc.
Now I found it works well if I do not start wifi task, so maybe a high level interrupt was allocated to wifi task? which function or macro can disable high level interrupts.
Re: 如何彻底关闭中断
I've tried changing
#define XCHAL_EXCM_LEVEL 3 /* level masked by PS.EXCM */
to
#define XCHAL_EXCM_LEVEL 5 /* level masked by PS.EXCM */
but it doesn't work.
#define XCHAL_EXCM_LEVEL 3 /* level masked by PS.EXCM */
to
#define XCHAL_EXCM_LEVEL 5 /* level masked by PS.EXCM */
but it doesn't work.
Who is online
Users browsing this forum: No registered users and 158 guests