Skip to content

Commit

Permalink
motorsGetRatio: match docstring and implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
whoenig committed May 29, 2024
1 parent e5eafd5 commit c82b64b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/drivers/interface/motors.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ void motorsBurstDshot();
void motorsSetRatio(uint32_t id, uint16_t ratio);

/**
* Get the PWM ratio of the motor 'id'. Return -1 if wrong ID.
* Get the PWM ratio of the motor 'id'.
*/
int motorsGetRatio(uint32_t id);
uint16_t motorsGetRatio(uint32_t id);

/**
* FreeRTOS Task to test the Motors driver
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/src/motors.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

static uint8_t motorSetEnable = 0;
static uint16_t motorPowerSet[] = {0, 0, 0, 0}; // user-requested PWM signals (overrides)
static uint32_t motor_ratios[] = {0, 0, 0, 0}; // actual PWM signals
static uint16_t motor_ratios[] = {0, 0, 0, 0}; // actual PWM signals

#ifdef CONFIG_MOTORS_ESC_PROTOCOL_DSHOT
static DMA_InitTypeDef DMA_InitStructureShare;
Expand Down Expand Up @@ -584,7 +584,7 @@ int motorsESCIsLo(uint32_t id)
return GPIO_ReadInputDataBit(motorMap[id]->gpioPort, motorMap[id]->gpioPin) == Bit_RESET;
}

int motorsGetRatio(uint32_t id)
uint16_t motorsGetRatio(uint32_t id)
{
ASSERT(id < NBR_OF_MOTORS);

Expand Down

0 comments on commit c82b64b

Please sign in to comment.