Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of busy-wait inside IRAM_ATTR function: core_esp8266_waveform_pwm.cpp #7974

Open
dok-net opened this issue Apr 11, 2021 · 0 comments
Open
Milestone

Comments

@dok-net
Copy link
Contributor

dok-net commented Apr 11, 2021

@earlephilhower Please check the busy-wait (idle == false)

  while (pwmState.pwmUpdate) {
    if (idle) {
      delay(0);
    }
    MEMBARRIER();
  }

from static IRAM_ATTR void _notifyPWM(PWMState *p, bool idle)
from IRAM_ATTR bool _stopPWM_weak(uint8_t pin)

A. This causes a busy wait inside an ISR (#8043).
B. The IRQ for PWM (NMI) does interrupt other ISRs that may be busy-waiting in notifyPWM. OK.
C. Won't any other GPIO interrupt still be blocked by the waiting ISR in A? Therefore, depending on how long PWM needs to clear the ISR in A to continue in _notifyPWM, every GPIO IRQ gets delayed? Does this leave room for acceptable responsiveness?

@earlephilhower earlephilhower added this to the 3.0.1 milestone May 17, 2021
@dok-net dok-net changed the title Use of non-IRAM_ATTR function inside IRAM_ATTR function: core_esp8266_waveform_pwm.cpp Use of busy-wait inside IRAM_ATTR function: core_esp8266_waveform_pwm.cpp May 18, 2021
@d-a-v d-a-v modified the milestones: 3.0.1, 3.1 Jun 24, 2021
@d-a-v d-a-v modified the milestones: 3.1, 4.0.0 Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants