Skip to content

Commit 06d8d46

Browse files
committed
Fix compiler warning: 'return' with a value
Fix #44 cores/arduino/stm32/analog.c:723:40: warning: 'return' with a value, in function returning void if (timHandle.Instance == NC) return 0; Signed-off-by: Frederic.Pillon <[email protected]>
1 parent bc76435 commit 06d8d46

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cores/arduino/stm32/analog.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ void pwm_start(PinName pin, uint32_t clock_freq,
720720

721721
/* Compute the prescaler value to have TIM counter clock equal to clock_freq Hz */
722722
timHandle.Instance = pinmap_peripheral(pin, PinMap_PWM);
723-
if (timHandle.Instance == NC) return 0;
723+
if (timHandle.Instance == NC) return;
724724
timHandle.Init.Prescaler = (uint32_t)(getTimerClkFreq(timHandle.Instance) / clock_freq) - 1;
725725
timHandle.Init.Period = period -1;
726726
timHandle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
@@ -781,9 +781,9 @@ void pwm_stop(PinName pin)
781781
uint32_t timChannel;
782782

783783
timHandle.Instance = pinmap_peripheral(pin, PinMap_PWM);
784-
if (timHandle.Instance == NC) return 0;
784+
if (timHandle.Instance == NC) return;
785785
timChannel = get_pwm_channel(pin);
786-
if (!IS_TIM_CHANNELS(timChannel)) return 0;
786+
if (!IS_TIM_CHANNELS(timChannel)) return;
787787

788788
#ifndef STM32L0xx
789789
if (STM_PIN_INVERTED(pinmap_function(pin, PinMap_PWM))) {

0 commit comments

Comments
 (0)