led: Fix crashes from PWM callbacks

Previously, starting a Rainbow() or Pulse() pattern multiple times on
one LED or switching between patterns on the two LEDs crashed the
device.

Update the PicoPwmGpio implementation so calling SetCallback() doesn't
require clearing callbacks on other instances first.

Change-Id: Idcf318cceb2476eddce8e26553ce16e0ad4f5c2b
Reviewed-on: https://pigweed-internal-review.git.corp.google.com/c/pigweed/showcase/rp2/+/73674
Commit-Queue: Auto-Submit <auto-submit@pw-internal-service-accounts.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-internal-scoped@luci-project-accounts.iam.gserviceaccount.com>
10 files changed
tree: ba0d3e775b9cbd2862886755b7d78fa32bf6ec85
  1. .github/
  2. .vscode/
  3. apps/
  4. device/
  5. modules/
  6. system/
  7. targets/
  8. tools/
  9. web_app/
  10. .bazelignore
  11. .bazelrc
  12. .bazelversion
  13. .buildifier.json
  14. .clang-format
  15. .clangd.shared
  16. .gitignore
  17. .pw_console.yaml
  18. AUTHORS
  19. BUILD.bazel
  20. CONTRIBUTING.md
  21. LICENSE
  22. MODULE.bazel
  23. OWNERS
  24. pigweed.json
  25. README.md
README.md

Pigweed Open Source Template Repository

This repository is a template that we will use when creating new open source repositories for Pigweed.