MCPcopy Index your code
hub / github.com/RT-Thread/rt-thread / rt_event_create

Function rt_event_create

src/ipc.c:1880–1904  ·  view source on GitHub ↗

* @brief Creating an event object. * * @note For the event object, its memory space is allocated automatically. * By contrast, the rt_event_init() function will initialize a static event object. * * @see rt_event_init() * * @param name is a pointer to the name that given to the event. * * @param flag is the event flag, which determines the queuing way of how mu

Source from the content-addressed store, hash-verified

1878 * @warning This function can ONLY be called from threads.
1879 */
1880rt_event_t rt_event_create(const char *name, rt_uint8_t flag)
1881{
1882 rt_event_t event;
1883
1884 RT_ASSERT((flag == RT_IPC_FLAG_FIFO) || (flag == RT_IPC_FLAG_PRIO));
1885
1886 RT_DEBUG_NOT_IN_INTERRUPT;
1887
1888 /* allocate object */
1889 event = (rt_event_t)rt_object_allocate(RT_Object_Class_Event, name);
1890 if (event == RT_NULL)
1891 return event;
1892
1893 /* set parent */
1894 event->parent.parent.flag = flag;
1895
1896 /* initialize ipc object */
1897 _ipc_object_init(&(event->parent));
1898
1899 /* initialize event */
1900 event->set = 0;
1901 rt_spin_lock_init(&(event->spinlock));
1902
1903 return event;
1904}
1905RTM_EXPORT(rt_event_create);
1906
1907

Callers 14

audio_speaker_initFunction · 0.85
audio_mic_initFunction · 0.85
sys_event_createFunction · 0.85
utest_tc_initFunction · 0.85
test_tcpFunction · 0.85
test_udpFunction · 0.85
drv_sd.cFile · 0.85
rt_hw_sdio_initFunction · 0.85
test_event_createFunction · 0.85
test_event_deleteFunction · 0.85
rt_perf_thread_eventFunction · 0.85

Calls 3

rt_object_allocateFunction · 0.85
_ipc_object_initFunction · 0.85
rt_spin_lock_initFunction · 0.70

Tested by 5

test_tcpFunction · 0.68
test_udpFunction · 0.68
test_event_createFunction · 0.68
test_event_deleteFunction · 0.68