nano_work: Add nano_work_init

Change-Id: I2e54e3e6ad048ff0d85cbef83e415ad436ecf720
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2016-05-13 15:13:37 +03:00 committed by Anas Nashif
parent b7a72220ea
commit 21fabb3d39
2 changed files with 10 additions and 1 deletions

View file

@ -53,6 +53,15 @@ struct nano_work {
work_handler_t handler;
};
/**
* @brief Initialize work item
*/
static inline void nano_work_init(struct nano_work *work,
work_handler_t handler)
{
work->handler = handler;
}
/**
* @brief Submit a work item to a workqueue.
*/

View file

@ -62,7 +62,7 @@ static void test_items_init(void)
for (i = 0; i < NUM_TEST_ITEMS; i++) {
tests[i].key = i + 1;
tests[i].work.handler = work_handler;
nano_work_init(&tests[i].work, work_handler);
}
}