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

Compatibility and IRQ fixed for waveform/tone/pwm #4872

Merged
merged 3 commits into from
Jul 2, 2018

Commits on Jul 1, 2018

  1. Compatibility and IRQ fixed for waveform/tone/pwm

    Fix a compiler ambiguity introduced with a floating point frequency option
    for tone().  Thanks to @Rob58329 for discovering this and proposing the
    fix.
    
    Match original analogWrite behavior by going from 0...1023 (PWMRANGE) and
    not 0...1024, and also explicitly set the analogWrite pin to an OUTPUT.
    Thanks to @JAndrassy for finding this.
    
    Fixes esp8266#4380 discovered by @cranphin where interrupts were disabled on a
    stopWaveform().  Remove that completely and bracket the update of non-atomic
    fields in the structure with disable/enable IRQs for safety.
    earlephilhower committed Jul 1, 2018
    Configuration menu
    Copy the full SHA
    a59cc74 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f55fc77 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2018

  1. Fix tone(int,int,int) infinite loop

    Explicitly cast the frequency, when passed in as an int, to an
    unsigned int.  Verified with snippet:
      tone(D1, (int)1000, 500);
      tone(D1, (unsigned int)1000, 500);
      tone(D1, 1000.0, 500);
      tone(D1, (int)1000);
      tone(D1, (unsigned int)1000);
      tone(D1, 1000.0);
    earlephilhower committed Jul 2, 2018
    Configuration menu
    Copy the full SHA
    a812e27 View commit details
    Browse the repository at this point in the history