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

Migration of pwmWrite.cpp #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sturmfink
Copy link

Migrated to arduino-esp32 v3.0

- fixed breaking changes as per ESP32 LEDC API

--> https://github.com/espressif/arduino-esp32/blob/master/docs/en/migration_guides/2.x_to_3.0.rst#ledc

...
LEDC

The LEDC API has been changed in order to support the Peripheral Manager and make it easier to use, as LEDC channels are now automatically assigned to pins. For more information about the new API, check :doc:/api/ledc.

Removed APIs

ledcSetup
ledcAttachPin
New APIs

ledcAttach used to set up the LEDC pin (merged ledcSetup and ledcAttachPin functions).
ledcOutputInvert used to attach the interrupt to a timer using arguments.
ledcFade used to set up and start a fade on a given LEDC pin.
ledcFadeWithInterrupt used to set up and start a fade on a given LEDC pin with an interrupt.
ledcFadeWithInterruptArg used to set up and start a fade on a given LEDC pin with an interrupt using arguments.
Changes in APIs

ledcDetachPin renamed to ledcDetach.
In all functions, input parameter channel has been changed to pin.
...

- fixed missing includes to gpio_struct.h and gpis_periph.h

automatic includes seem to be buggy in 3.0 so I included the necessary references

...
#include "soc/gpio_struct.h"
#include "soc/gpio_periph.h"
...

and now everything should run smoothly.

Migrated to arduino-esp32 v3.0

- fixed breaking changes in ESP32  LEDC API
https://github.com/espressif/arduino-esp32/blob/master/docs/en/migration_guides/2.x_to_3.0.rst#ledc

- fixed missing includes to gpio_struct.h and gpis_periph.h
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

Successfully merging this pull request may close these issues.

1 participant