You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using clock_control.h in an app, it does not compile due to warnings.
The return value of the function in an enum, but in case the device is not ready, a posix error code is returned.
staticinlineenumclock_control_statusclock_control_get_status(conststructdevice*dev,
clock_control_subsys_tsys)
{
conststructclock_control_driver_api*api=
(conststructclock_control_driver_api*)dev->api;
if (!api->get_status) {
returnCLOCK_CONTROL_STATUS_UNKNOWN;
}
if (!device_is_ready(dev)) {
return-ENODEV;
}
returnapi->get_status(dev, sys);
}
To Reproduce
Compile a C++ app that includes clock_control.h
Expected behavior
Only return values from the enum
Impact
APP does not compile
Logs and console output
zephyr/include/drivers/clock_control.h:193:11: error: invalid conversion from 'int' to 'clock_control_status' [-fpermissive]
193 | return -ENODEV;
| ^~~~~~
| |
| int
The text was updated successfully, but these errors were encountered:
Describe the bug
When using clock_control.h in an app, it does not compile due to warnings.
The return value of the function in an enum, but in case the device is not ready, a posix error code is returned.
To Reproduce
Compile a C++ app that includes clock_control.h
Expected behavior
Only return values from the enum
Impact
APP does not compile
Logs and console output
The text was updated successfully, but these errors were encountered: