看下实现,就是给一个任务发送了一个事件。event 有3个参数,第一个参数是回调,第2个参数是回调函数的实现,第3个参数是回调函数的参数。
bool osiThreadCallback(osiThread_t *thread, osiCallback_t cb, void *cb_ctx) { if (thread == NULL || cb == NULL) return false; osiEvent_t event = { .id = OSI_EVENT_ID_CALLBACK, .param1 = (uint32_t)cb, .param2 = (uint32_t)cb_ctx, .param3 = 0, }; if (IS_IRQ()) return osiEventTrySend(thread, &event, 0); return osiEventSend(thread, &event); }
标签:return,thread,cb,什么,用途,参数,osiThreadCallback,event From: https://www.cnblogs.com/429512065qhq/p/16806771.html