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

Function rt_event_control

src/ipc.c:2268–2296  ·  view source on GitHub ↗

* @brief This function will set some extra attributions of an event object. * * @note Currently this function only supports the RT_IPC_CMD_RESET command to reset the event. * * @param event is a pointer to an event object. * * @param cmd is a command word used to configure some attributions of the event. * * @param arg is the argument of the function to execute the command.

Source from the content-addressed store, hash-verified

2266 * If the return value is any other values, it means that this function failed to execute.
2267 */
2268rt_err_t rt_event_control(rt_event_t event, int cmd, void *arg)
2269{
2270 rt_base_t level;
2271
2272 RT_UNUSED(arg);
2273
2274 /* parameter check */
2275 RT_ASSERT(event != RT_NULL);
2276 RT_ASSERT(rt_object_get_type(&event->parent.parent) == RT_Object_Class_Event);
2277
2278 if (cmd == RT_IPC_CMD_RESET)
2279 {
2280 level = rt_spin_lock_irqsave(&(event->spinlock));
2281
2282 /* resume all waiting thread */
2283 rt_susp_list_resume_all(&event->parent.suspend_thread, RT_ERROR);
2284
2285 /* initialize event set */
2286 event->set = 0;
2287
2288 rt_spin_unlock_irqrestore(&(event->spinlock), level);
2289
2290 rt_schedule();
2291
2292 return RT_EOK;
2293 }
2294
2295 return -RT_ERROR;
2296}
2297RTM_EXPORT(rt_event_control);
2298
2299/**@}*/

Callers 7

rt_link_initFunction · 0.85
sdhci_transfer_blockingFunction · 0.85
_uart_dma_writeFunction · 0.85
test_pdma_txFunction · 0.85
test_pdma_rxFunction · 0.85
rthw_sdio_send_commandFunction · 0.85
rthw_sdio_send_commandFunction · 0.85

Calls 5

rt_object_get_typeFunction · 0.85
rt_susp_list_resume_allFunction · 0.85
rt_spin_lock_irqsaveFunction · 0.70
rt_scheduleFunction · 0.70

Tested by 2

test_pdma_txFunction · 0.68
test_pdma_rxFunction · 0.68