-
Notifications
You must be signed in to change notification settings - Fork 928
Open
Description
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
ESP-IDF v6.1-dev-918-gb111c84f9e
Espressif SoC revision.
ESP32-S3 (QFN56) (revision v0.2)
Operating System used.
macOS
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-S3-DevKitC1
Steps to reproduce.
- Install esp_sensorless_bldc_control as explained in the readme
- Integrate in a project or compile an example that uses it
- During build, observe the error
Build Logs.
/Project_root_folder/managed_components/espressif__esp_sensorless_bldc_control/hardware_driver/bldc_mcpwm.c: In function 'bldc_mcpwm_init': /Project_root_folder/managed_components/espressif__esp_sensorless_bldc_control/hardware_driver/bldc_mcpwm.c:60:15: error: implicit declaration of function 'mcpwm_generator_set_actions_on_compare_event'; did you mean 'mcpwm_generator_set_action_on_compare_event'? [-Wimplicit-function-declaration] 60 | err = mcpwm_generator_set_actions_on_compare_event(bldc_mcpwm_ctx->generators[i], | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | mcpwm_generator_set_action_on_compare_event /Project_root_folder/managed_components/espressif__esp_sensorless_bldc_control/hardware_driver/bldc_mcpwm.c:63:60: error: implicit declaration of function 'MCPWM_GEN_COMPARE_EVENT_ACTION_END'; did you mean 'MCPWM_GEN_COMPARE_EVENT_ACTION'? [-Wimplicit-function-declaration] 63 | MCPWM_GEN_COMPARE_EVENT_ACTION_END()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | MCPWM_GEN_COMPARE_EVENT_ACTION
More Information.
The solution is listed here: https://github.com/espressif/esp-idf/blob/683ddf8a6eeaf9189679273ba37b3fc82f515df0/docs/en/migration-guides/release-6.x/6.0/peripherals.rst#id5
Line 60 - 62 need to be replaced as instructed in the link above. The current release of the library on github is not compatible with ESP-IDF V6.1 due to this issue:
Variadic Generator APIs are Removed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The legacy variadic ("varg") generator APIs have been removed in this release. Code that used vararg-style calls for generator action setup must be migrated to the explicit, typed APIs. These APIs use configuration structs and clearly-typed setter functions (for example, :cpp:type:`mcpwm_generator_config_t`, :cpp:type:`mcpwm_gen_timer_event_action_t` and :cpp:type:`mcpwm_generator_set_action_on_timer_event`).
Migration steps (summary):
- Replace varg-style action configuration with helper structs/macros and dedicated setter functions::
.. code-block:: c
/* Old (varg) */
mcpwm_generator_set_actions_on_compare_event(my_generator,
MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, my_comparator, MCPWM_GEN_ACTION_LOW),
MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_DOWN, my_comparator, MCPWM_GEN_ACTION_HIGH),
MCPWM_GEN_COMPARE_EVENT_ACTION_END());
/* New */
mcpwm_generator_set_action_on_compare_event(my_generator,
MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, my_comparator, MCPWM_GEN_ACTION_LOW));
mcpwm_generator_set_action_on_compare_event(my_generator,
MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_DOWN, my_comparator, MCPWM_GEN_ACTION_HIGH));