MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_event_init

Function rt_event_init

src/ipc.c:1788–1808  ·  view source on GitHub ↗

* @brief The function will initialize a static event object. * * @note For the static event object, its memory space is allocated by the compiler during compiling, * and shall placed on the read-write data segment or on the uninitialized data segment. * By contrast, the rt_event_create() function will allocate memory space automatically * and initialize th

Source from the content-addressed store, hash-verified

1786 * @warning This function can ONLY be called from threads.
1787 */
1788rt_err_t rt_event_init(rt_event_t event, const char *name, rt_uint8_t flag)
1789{
1790 /* parameter check */
1791 RT_ASSERT(event != RT_NULL);
1792 RT_ASSERT((flag == RT_IPC_FLAG_FIFO) || (flag == RT_IPC_FLAG_PRIO));
1793
1794 /* initialize object */
1795 rt_object_init(&(event->parent.parent), RT_Object_Class_Event, name);
1796
1797 /* set parent flag */
1798 event->parent.parent.flag = flag;
1799
1800 /* initialize ipc object */
1801 _ipc_object_init(&(event->parent));
1802
1803 /* initialize event */
1804 event->set = 0;
1805 rt_spin_lock_init(&(event->spinlock));
1806
1807 return RT_EOK;
1808}
1809RTM_EXPORT(rt_event_init);
1810
1811

Callers 15

rt_usb_vcom_initFunction · 0.85
enc28j60_attachFunction · 0.85
rt_hw_wifi_initFunction · 0.85
rt_wlan_complete_createFunction · 0.85
rt_alarm_system_initFunction · 0.85
_bus_in_entryFunction · 0.85
rt_link_initFunction · 0.85
rt_link_dev_registerFunction · 0.85
ThreadMethod · 0.85
at_client_para_initFunction · 0.85
rthw_sdctrl_createFunction · 0.85

Calls 3

rt_object_initFunction · 0.85
_ipc_object_initFunction · 0.85
rt_spin_lock_initFunction · 0.70

Tested by 10

utest_tc_initFunction · 0.68
task_registrationFunction · 0.68
gpio_input_testFunction · 0.68
task_registrationFunction · 0.68
gpio_input_testFunction · 0.68
task_registrationFunction · 0.68
gpio_input_testFunction · 0.68
test_event_initFunction · 0.68
test_event_detachFunction · 0.68