Skip to content

Commit f467d5d

Browse files
authored
Merge pull request #581 from suda-morris/refactor/bdc_motor_update
refactor(bdc_motor): use non-varg version of generator actions settin…
2 parents b2cf4eb + 4c46c70 commit f467d5d

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

bdc_motor/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "0.2.0"
1+
version: "0.2.1"
22
description: Brushed DC Motor Control Driver
33
url: https://github.com/espressif/idf-extra-components/tree/master/bdc_motor
44
repository: https://github.com/espressif/idf-extra-components.git

bdc_motor/src/bdc_motor_mcpwm_impl.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,14 @@ esp_err_t bdc_motor_new_mcpwm_device(const bdc_motor_config_t *motor_config, con
135135
generator_config.gen_gpio_num = motor_config->pwmb_gpio_num;
136136
ESP_GOTO_ON_ERROR(mcpwm_new_generator(mcpwm_motor->operator, &generator_config, &mcpwm_motor->genb), err, TAG, "create generator failed");
137137

138-
mcpwm_generator_set_actions_on_timer_event(mcpwm_motor->gena,
139-
MCPWM_GEN_TIMER_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, MCPWM_TIMER_EVENT_EMPTY, MCPWM_GEN_ACTION_HIGH),
140-
MCPWM_GEN_TIMER_EVENT_ACTION_END());
141-
mcpwm_generator_set_actions_on_compare_event(mcpwm_motor->gena,
142-
MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, mcpwm_motor->cmpa, MCPWM_GEN_ACTION_LOW),
143-
MCPWM_GEN_COMPARE_EVENT_ACTION_END());
144-
mcpwm_generator_set_actions_on_timer_event(mcpwm_motor->genb,
145-
MCPWM_GEN_TIMER_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, MCPWM_TIMER_EVENT_EMPTY, MCPWM_GEN_ACTION_HIGH),
146-
MCPWM_GEN_TIMER_EVENT_ACTION_END());
147-
mcpwm_generator_set_actions_on_compare_event(mcpwm_motor->genb,
148-
MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, mcpwm_motor->cmpb, MCPWM_GEN_ACTION_LOW),
149-
MCPWM_GEN_COMPARE_EVENT_ACTION_END());
138+
mcpwm_generator_set_action_on_timer_event(mcpwm_motor->gena,
139+
MCPWM_GEN_TIMER_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, MCPWM_TIMER_EVENT_EMPTY, MCPWM_GEN_ACTION_HIGH));
140+
mcpwm_generator_set_action_on_compare_event(mcpwm_motor->gena,
141+
MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, mcpwm_motor->cmpa, MCPWM_GEN_ACTION_LOW));
142+
mcpwm_generator_set_action_on_timer_event(mcpwm_motor->genb,
143+
MCPWM_GEN_TIMER_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, MCPWM_TIMER_EVENT_EMPTY, MCPWM_GEN_ACTION_HIGH));
144+
mcpwm_generator_set_action_on_compare_event(mcpwm_motor->genb,
145+
MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, mcpwm_motor->cmpb, MCPWM_GEN_ACTION_LOW));
150146

151147
mcpwm_motor->base.enable = bdc_motor_mcpwm_enable;
152148
mcpwm_motor->base.disable = bdc_motor_mcpwm_disable;

0 commit comments

Comments
 (0)