drivers/timer: Add default z_clock_set_timeout() fallback
Useful for tick-only drivers like Pulpino that don't support this. Ideally we'd have a header-level interface definition for individual timer drivers to eliminate the noop function call, but this is clean for now (even the Pulpino hardware looks like it should support timeouts just fine, so effort would be better spent there than on a clean "ticked" interface). Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
8b54953e4b
commit
bf531ac4fc
1 changed files with 6 additions and 0 deletions
|
@ -19,6 +19,8 @@
|
|||
SYS_DEVICE_DEFINE("sys_clock", z_clock_driver_init, z_clock_device_ctrl,
|
||||
PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);
|
||||
|
||||
/* Weak-linked noop defaults for optional driver interfaces: */
|
||||
|
||||
int __weak z_clock_driver_init(struct device *device)
|
||||
{
|
||||
return 0;
|
||||
|
@ -29,3 +31,7 @@ int __weak z_clock_device_ctrl(struct device *device,
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __weak z_clock_set_timeout(s32_t ticks, bool idle)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue