Skip to content

Conversation

@henrikbrixandersen
Copy link
Member

Fix compilation with pwm.h with CONFIG_PWM_CAPTURE=n.

Signed-off-by: Henrik Brix Andersen [email protected]

Fix compilation with pwm.h with CONFIG_PWM_CAPTURE=n.

Signed-off-by: Henrik Brix Andersen <[email protected]>
@henrikbrixandersen henrikbrixandersen added area: PWM Pulse Width Modulation Hotfix Fix for issues blocking development, i.e. upstream CI issues, tests failing in upstream CI , etc. labels Jan 12, 2021
@github-actions github-actions bot added the area: API Changes to public APIs label Jan 12, 2021
@henrikbrixandersen
Copy link
Member Author

This fixes warnings like the following, as seen in https://buildkite.com/zephyr/zephyr/builds/17735#7b50a655-5ca5-486e-aa97-a598aae24df4:

In file included from /workdir/zephyr/drivers/led/led_pwm.c:15:
--
  | ../../../../../../include/drivers/pwm.h:211:19: error: 'pwm_pin_configure_capture' declared 'static' but never defined [-Werror=unused-function]
  | 211 \| static inline int pwm_pin_configure_capture(const struct device *dev,
  | \|                   ^~~~~~~~~~~~~~~~~~~~~~~~~
  | cc1: all warnings being treated as errors

Not sure why this wasn't caught in CI on #26025.

* @retval -EIO if IO error occurred while configuring
* @retval -EBUSY if PWM capture is already in progress
*/
static inline int pwm_pin_configure_capture(const struct device *dev,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But doesn't this remove the anchor to which the documentation attaches, so it won't be documented?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if the prototype removes static inline it might work. I'm testing it in #31265 as well; see https://github.com/zephyrproject-rtos/zephyr/compare/e3d115573a9389e965c660693b9b0ce07cfc3301..57e3821567f4fe685a5b865269254007198d2db2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pabigot No, the documentation build still gets the correct result. I already tried several permutations of inline, static, __unused etc. without any luck.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah: that's because you have CONFIG_PWM_CAPTURE in the doxygen predefines. OK.

@nashif nashif merged commit 7aeb3df into zephyrproject-rtos:master Jan 12, 2021
@henrikbrixandersen henrikbrixandersen deleted the pwm_pin_configure_capture_hotfix branch January 14, 2021 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: API Changes to public APIs area: PWM Pulse Width Modulation Hotfix Fix for issues blocking development, i.e. upstream CI issues, tests failing in upstream CI , etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants