| 319 | */ |
| 320 | |
| 321 | static void _sem_object_init(rt_sem_t sem, |
| 322 | rt_uint16_t value, |
| 323 | rt_uint8_t flag, |
| 324 | rt_uint16_t max_value) |
| 325 | { |
| 326 | /* initialize ipc object */ |
| 327 | _ipc_object_init(&(sem->parent)); |
| 328 | |
| 329 | sem->max_value = max_value; |
| 330 | /* set initial value */ |
| 331 | sem->value = value; |
| 332 | |
| 333 | /* set parent */ |
| 334 | sem->parent.parent.flag = flag; |
| 335 | rt_spin_lock_init(&(sem->spinlock)); |
| 336 | } |
| 337 | |
| 338 | /** |
| 339 | * @brief This function will initialize a static semaphore object. |
no test coverage detected