include: usb: add iterable section in ram for usb_cfg_data

Add iterable section in ram for struct usb_cfg_data and
new makro USBD_DEFINE_CFG_DATA which should be used to
define usb_cfg_date structures.

Deprecate makro USBD_CFG_DATA_DEFINE.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2021-12-09 00:06:09 +01:00 committed by Maureen Helm
commit b1356e969d
3 changed files with 11 additions and 2 deletions

View file

@ -67,8 +67,11 @@ extern "C" {
* This macro should be used to place the struct usb_cfg_data
* inside usb data section in the RAM.
*/
#define USBD_CFG_DATA_DEFINE(p, name) \
static __in_section(usb, data_##p, name) __used __aligned(4)
#define USBD_DEFINE_CFG_DATA(name) \
static STRUCT_SECTION_ITERABLE(usb_cfg_data, name)
#define USBD_CFG_DATA_DEFINE(p, name) __DEPRECATED_MACRO \
static __in_section(_usb_cfg_data, static, p##_name) __used __aligned(4)
/*************************************************************************
* USB configuration