Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: rtc: pcf8563: minor fixes to the driver #87336

Merged

Conversation

valeriosetti
Copy link
Collaborator

@valeriosetti valeriosetti commented Mar 19, 2025

  • Define alarm_set_callback() only when CONFIG_RTC_ALARM is set otherwise
    a warning will be generated at runtime for the function not being
    used.

  • add "static" keyword to all internal functions.

#ifdef PCF8563_INT1_GPIOS_IN_USE
/* The logic related to the pin interrupt logic */

void callback_work_handler(struct k_work *work)
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add static keyword to the functions as well, with this, the warning would likely have been caught faster :)

- Define alarm_set_callback() only when CONFIG_RTC_ALARM is set otherwise
a warning will be generated at runtime for the function not being
used.

- add "static" keyword to all internal functions.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
@valeriosetti valeriosetti force-pushed the fix-rtc-alarm-callback branch from 0e683f0 to c4f938d Compare March 19, 2025 15:48
@valeriosetti valeriosetti changed the title drivers: rtc: pcf8563: define alarm_set_callback only when CONFIG_RTC_ALARM drivers: rtc: pcf8563: minor fixes to the driver Mar 19, 2025
Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

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

Nice!

@kartben kartben merged commit e234473 into zephyrproject-rtos:main Mar 21, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: RTC Real Time Clock
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants