26 lines
592 B
C
26 lines
592 B
C
|
|
#ifndef BLINKY_USB_FUNCTION_HOOK_H_
|
||
|
|
#define BLINKY_USB_FUNCTION_HOOK_H_
|
||
|
|
|
||
|
|
#include <zephyr/sys/iterable_sections.h>
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
extern "C" {
|
||
|
|
#endif
|
||
|
|
|
||
|
|
struct usb_function_hook {
|
||
|
|
const char *name;
|
||
|
|
int (*pre_stack_init)(void);
|
||
|
|
};
|
||
|
|
|
||
|
|
#define USB_FUNCTION_HOOK_DEFINE(_name, _pre_stack_init) \
|
||
|
|
const STRUCT_SECTION_ITERABLE(usb_function_hook, _name) = { \
|
||
|
|
.name = STRINGIFY(_name), \
|
||
|
|
.pre_stack_init = (_pre_stack_init), \
|
||
|
|
}
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#endif /* BLINKY_USB_FUNCTION_HOOK_H_ */
|