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.
Thanks for reply.
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.