-
Notifications
You must be signed in to change notification settings - Fork 126
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
MCPWM_GEN_COMPARE_EVENT_ACTION_END() doesnt exist? #337
Comments
We dont directly translate preprocessor C macros into rust code. That is true for every C macro. Though you don't need to loose hope ;D Just have a look at the definition of the macro and you see, all it does it creates a additional instance of mcpwm_gen_compare_event_action_t in the last spot, and set the comparator field to Null. In other words you need to make sure that for the last element mcpwm_gen_compare_event_action_t the comparator field is set NULL. |
This is also what we do when we have to reach to ESP IDF function macros... A more complex idea would be for |
Ok, good to know! Thanks a lot for the quick response guys! |
Hi there,
Ive looked through the open and closed issues, but it doesnt look like this has been discussed so far.
After creating a MCPWM generator, it can be fed with a list of actions via
esp_idf_sys::mcpwm_generator_set_actions_on_compare_event
This list needs to be terminated with this macro:
MCPWM_GEN_COMPARE_EVENT_ACTION_END()
which I cannot find anywhere in the crate. Also, the existing actions are just constants from 0 to 3. So just feeding a 0 at the end wont work either.
Workaround is obviously to use the function which only feeds one action at a time:
esp_idf_sys::mcpwm_generator_set_action_on_compare_event
I guess its not that of a big deal, but it just leads to more boilerplate code when a longer list is used.
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/peripherals/mcpwm.html#mcpwm-generator-actions-on-events
The text was updated successfully, but these errors were encountered: