From c82b64be5aa3fbc669bf24a3ce81c9ec491a0be9 Mon Sep 17 00:00:00 2001 From: Wolfgang Hoenig Date: Wed, 29 May 2024 22:07:07 +0200 Subject: [PATCH] motorsGetRatio: match docstring and implementation --- src/drivers/interface/motors.h | 4 ++-- src/drivers/src/motors.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/interface/motors.h b/src/drivers/interface/motors.h index e480123dd2..ce88259a25 100644 --- a/src/drivers/interface/motors.h +++ b/src/drivers/interface/motors.h @@ -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 diff --git a/src/drivers/src/motors.c b/src/drivers/src/motors.c index 1e03f7cf71..2f425736a3 100644 --- a/src/drivers/src/motors.c +++ b/src/drivers/src/motors.c @@ -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; @@ -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);