Example #1
0
void  *SerialOS_SemCreate (CPU_INT16U  cnt)
{
    OS_SEM   *psem;
    LIB_ERR   lib_err;
    OS_ERR    os_err;


    psem = (OS_SEM *)Mem_PoolBlkGet((MEM_POOL    *)&OS_SemPool,
                                    (CPU_SIZE_T   ) sizeof(OS_SEM),
                                    (LIB_ERR     *)&lib_err);

    if (lib_err != LIB_MEM_ERR_NONE) {
        return ((void *)0);
    }

    OSSemCreate((OS_SEM      *)psem,
                (CPU_CHAR    *)0,
                (OS_SEM_CTR   )cnt,
                (OS_ERR      *)&os_err);

    if (os_err != OS_ERR_NONE) {
        Mem_PoolBlkFree((MEM_POOL  *)&OS_SemPool,
                        (void      *) psem,
                        (LIB_ERR   *)&lib_err);
        return ((void *)0);
    }

    return ((void *)psem);
}
Example #2
0
void  SerialOS_SemDel (void  *psem)
{
    LIB_ERR  lib_err;
    OS_ERR   os_err;


    OSSemPendAbort((OS_SEM  *)psem,
                   (OS_OPT   )OS_OPT_PEND_ABORT_ALL,
                   (OS_ERR  *)&os_err);

    OSSemDel((OS_SEM  *)psem,
             (OS_OPT   )OS_OPT_DEL_ALWAYS,
             (OS_ERR  *)&os_err);

    Mem_PoolBlkFree((MEM_POOL  *)&OS_SemPool,
                    (void      *) psem,
                    (LIB_ERR   *)&lib_err);
}
Example #3
0
void btstack_memory_l2cap_channel_free(l2cap_channel_t *l2cap_channel)
{
    LIB_ERR err;
    Mem_PoolBlkFree(&l2cap_channel_pool, l2cap_channel, &err);
}
Example #4
0
void btstack_memory_l2cap_service_free(l2cap_service_t *l2cap_service)
{
    LIB_ERR err;
    Mem_PoolBlkFree(&l2cap_service_pool, l2cap_service, &err);
}
Example #5
0
void btstack_memory_hci_connection_free(hci_connection_t *hci_connection)
{
    LIB_ERR err;
    Mem_PoolBlkFree(&hci_connection_pool, hci_connection, &err);
}
Example #6
0
void btstack_memory_db_mem_service_free(db_mem_service_t *db_mem_service){
    LIB_ERR err;
    Mem_PoolBlkFree(&db_mem_service_pool, db_mem_service, &err);
}
Example #7
0
void btstack_memory_rfcomm_channel_free(rfcomm_channel_t *rfcomm_channel)
{
    LIB_ERR err;
    Mem_PoolBlkFree(&rfcomm_channel_pool, rfcomm_channel, &err);
}
Example #8
0
void btstack_memory_rfcomm_service_free(rfcomm_service_t *rfcomm_service)
{
    LIB_ERR err;
    Mem_PoolBlkFree(&rfcomm_service_pool, rfcomm_service, &err);
}
Example #9
0
void btstack_memory_rfcomm_multiplexer_free(rfcomm_multiplexer_t *rfcomm_multiplexer)
{
    LIB_ERR err;
    Mem_PoolBlkFree(&rfcomm_multiplexer_pool, rfcomm_multiplexer, &err);
}