コード例 #1
0
StatusType InitMessage(MessageIdentifier Message, ApplicationDataRef DataRef)
#endif /* KOS_MEMORY_MAPPING */
{
/*
    Standard:
        · This service returns E_OK if the initialisation of the message object
          completed successfully.
        · This service returns an implementation-specific status code if the
          initialisation did not complete successfully.
    Extended:
        In addition to the standard status code defined above, the following
        status code is supported:
        · This service returns E_COM_ID if the parameter <Message> is
          out of range or refers to a zero-length message or to an internal transmit message.
 */
    SAVE_SERVICE_CONTEXT(COMServiceId_InitMessage, Message, DataRef, NULL);
    ASSERT_VALID_MESSAGE_ID(Message);
    ASSERT_CAN_INITIALIZE_MESSAGE(Message);

    DISABLE_ALL_OS_INTERRUPTS();
    Utl_MemCopy((void *)OSEK_COM_GET_MESSAGE_OBJECT(Message).Data, (void *)DataRef, (SizeType)OSEK_COM_GET_MESSAGE_OBJECT(
                    Message).Size);
    ENABLE_ALL_OS_INTERRUPTS();

    CLEAR_SERVICE_CONTEXT();
    return E_OK;
}
コード例 #2
0
ファイル: knx_ail.c プロジェクト: neptun2002/K-Stack
boolean KnxAIL_SetObject(uint16 objectNr, void * src)
#endif /* KSTACK_MEMORY_MAPPING */
{
    boolean appLoaded = LSM_IsAppLoaded();

    if ((objectNr < KnxALG_GetNumCommObjs()) && appLoaded) {
        Utl_MemCopy(KnxALG_GetObjectDataPointer(objectNr), src, KnxALG_GetObjLen(KnxALG_GetCommObjDescr(objectNr)->Type));
        return TRUE;
    } else {
        return FALSE;
    }
}
コード例 #3
0
void ComIf_UpdateAndNotifyReceivers(Com_MessageObjectType const * const MessageSendObject,
                                    ApplicationDataRef                  DataRef
                                    )
#endif /* KOS_MEMORY_MAPPING */
{
    uint8                           idx;
    Com_MessageObjectType const *   MessageObject;

#if defined(OS_EXTENDED_STATUS) && defined(OS_USE_CALLEVEL_CHECK)
    OsCallevelType CallevelSaved;
#endif

    ASSERT(MessageSendObject->Receiver != (Com_ReceiverType *)NULL);

    for (idx = (uint8)0; idx < MessageSendObject->NumReceivers; ++idx) {
        DISABLE_ALL_OS_INTERRUPTS();
        MessageObject = (Com_MessageObjectType *)&OSEK_COM_GET_MESSAGE_OBJECT(MessageSendObject->Receiver[idx].Message);
        ASSERT(MessageSendObject->Size == MessageObject->Size);
        ASSERT(MessageObject->Property == RECEIVE_UNQUEUED_INTERNAL);    /* todo: CCCB */
        ASSERT(MessageObject->Action.Dummy != (void *)NULL);
        Utl_MemCopy((void *)MessageObject->Data, (void *)DataRef, (SizeType)MessageObject->Size);
        ENABLE_ALL_OS_INTERRUPTS();

        switch (MessageObject->Notification) {  /* NotificationType??? */
            case COM_ACTIVATETASK:
                (void)OsTask_Activate(MessageObject->Action.TaskID);
                break;
            case COM_SETEVENT:
                (void)OsEvtSetEvent(MessageObject->Action.Event->TaskID, MessageObject->Action.Event->Mask);
                break;
            case COM_COMCALLBACK:
                DISABLE_ALL_OS_INTERRUPTS();
                #if defined(OS_EXTENDED_STATUS) && defined(OS_USE_CALLEVEL_CHECK)
                CallevelSaved = OS_GET_CALLEVEL();
                #endif
                OS_SET_CALLEVEL(OS_CL_ALARM_CALLBACK);
                (MessageObject->Action.Callback)();
                #if defined(OS_EXTENDED_STATUS) && defined(OS_USE_CALLEVEL_CHECK)
                OS_SET_CALLEVEL(CallevelSaved);
                #endif
                ENABLE_ALL_OS_INTERRUPTS();
                break;
            case COM_FLAG:
                /* todo: Implementieren (nicht CCCA) !!! */
/*                MessageObject->Action.Flag; */
                break;
            case COM_NOTIFY_NONE:
                break;  /* No Action. */
            default:
                ASSERT(FALSE);
        }
    }
}