/* retval kStatus_Success Lock the sema4 gate successfully. retval kStatus_Fail Sema4 gate has been locked by another processor.  */
status_t SEMA4_TryLock(SEMA4_Type *base, uint8_t gateNum, uint8_t procNum)
/* retval kStatus_Success Lock the sema4 gate successfully. retval kStatus_Fail Sema4 gate has been locked by another processor.  */
status_t SEMA4_TryLock(SEMA4_Type *base, uint8_t gateNum, uint8_t procNum)
{
    status_t status;
    assert(gateNum < (uint8_t)FSL_FEATURE_SEMA4_GATE_COUNT);
    ++procNum;
    SEMA4_GATEn(base, gateNum) = procNum;
    if (procNum != SEMA4_GATEn(base, gateNum))
    {
        status = kStatus_Fail;
    }
    else
    {
        status = kStatus_Success;
    }
    return status;
}