[DeviceDrivers] prepare for device driver v2.0 (#7697)
This commit is contained in:
parent
d1ed0f7ddb
commit
e3f068f058
|
@ -0,0 +1,15 @@
|
||||||
|
from building import *
|
||||||
|
|
||||||
|
cwd = GetCurrentDir()
|
||||||
|
src = ['device.c']
|
||||||
|
CPPPATH = [cwd + '/../include']
|
||||||
|
|
||||||
|
if GetDepend(['RT_USING_DEV_BUS']):
|
||||||
|
src = src + ['bus.c']
|
||||||
|
|
||||||
|
if GetDepend(['RT_USING_DM']):
|
||||||
|
src = src + ['driver.c']
|
||||||
|
|
||||||
|
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_DEVICE'], CPPPATH = CPPPATH)
|
||||||
|
|
||||||
|
Return('group')
|
|
@ -1,16 +1,16 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
|
#ifdef RT_USING_DM
|
||||||
|
|
||||||
#ifdef RT_USING_FDT
|
#ifdef RT_USING_FDT
|
||||||
#include <dtb_node.h>
|
#include <dtb_node.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined(RT_USING_POSIX_DEVIO)
|
|
||||||
#include <rtdevice.h> /* for wqueue_init */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function driver device match with id
|
* This function driver device match with id
|
||||||
|
@ -45,7 +45,6 @@ rt_err_t rt_driver_match_with_id(const rt_driver_t drv,int device_id)
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
RTM_EXPORT(rt_driver_match_with_id);
|
RTM_EXPORT(rt_driver_match_with_id);
|
||||||
|
|
||||||
#ifdef RT_USING_FDT
|
#ifdef RT_USING_FDT
|
||||||
|
@ -107,7 +106,8 @@ rt_err_t rt_driver_match_with_dtb(const rt_driver_t drv,void *from_node,int max_
|
||||||
rt_free(node_list);
|
rt_free(node_list);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
RTM_EXPORT(rt_driver_match_with_dtb);
|
RTM_EXPORT(rt_driver_match_with_dtb);
|
||||||
#endif
|
#endif /* RT_USING_FDT */
|
||||||
|
|
||||||
|
#endif /* RT_USING_DM */
|
||||||
|
|
|
@ -23,9 +23,6 @@ if GetDepend(['RT_USING_PULSE_ENCODER']):
|
||||||
if GetDepend(['RT_USING_INPUT_CAPTURE']):
|
if GetDepend(['RT_USING_INPUT_CAPTURE']):
|
||||||
src = src + ['rt_inputcapture.c']
|
src = src + ['rt_inputcapture.c']
|
||||||
|
|
||||||
if GetDepend(['RT_USING_DEV_BUS']):
|
|
||||||
src = src + ['rt_dev_bus.c']
|
|
||||||
|
|
||||||
if GetDepend(['RT_USING_NULL']):
|
if GetDepend(['RT_USING_NULL']):
|
||||||
src = src + ['rt_null.c']
|
src = src + ['rt_null.c']
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue