Skip to content

Commit

Permalink
drivers/motor_driver : Add CONFIG_
Browse files Browse the repository at this point in the history
Add CONFIG_ Prefix for MOTOR_DRIVER_MAX
  • Loading branch information
akshaim committed Apr 23, 2020
1 parent c2c32a4 commit 39826d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/include/motor_driver.h
Expand Up @@ -17,9 +17,9 @@
* Mainly designed for H-bridge, it could also drive some brushless drivers.
*
* Some H-bridge driver circuits handle several motors.
* Maximum motor number by H-bridge is set to 2 with MOTOR_DRIVER_MAX macro.
* Maximum motor number by H-bridge is set to 2 with CONFIG_MOTOR_DRIVER_MAX macro.
* This macro can be overridden to support H-bridge drivers with more outputs.
* However, MOTOR_DRIVER_MAX should not exceed PWM channels number.
* However, CONFIG_MOTOR_DRIVER_MAX should not exceed PWM channels number.
*
* motor_driver_t structure represents an H-bridge.
* As several H-bridge can share a same PWM device, motor_driver_t can
Expand Down Expand Up @@ -99,8 +99,8 @@ extern "C" {
/**
* @brief Maximum number of motors by motor driver
*/
#ifndef MOTOR_DRIVER_MAX
#define MOTOR_DRIVER_MAX (2)
#ifndef CONFIG_MOTOR_DRIVER_MAX
#define CONFIG_MOTOR_DRIVER_MAX (2)
#endif
/** @} */

Expand Down Expand Up @@ -173,7 +173,7 @@ typedef struct {
uint32_t pwm_frequency; /**< PWM device frequency */
uint32_t pwm_resolution; /**< PWM device resolution */
uint8_t nb_motors; /**< number of moros */
motor_t motors[MOTOR_DRIVER_MAX]; /**< motors array */
motor_t motors[CONFIG_MOTOR_DRIVER_MAX]; /**< motors array */
motor_driver_cb_t cb; /**< callback on motor_set */
} motor_driver_config_t;

Expand Down

0 comments on commit 39826d6

Please sign in to comment.