Subversion Repositories HomeAutomation

Rev

Rev 173 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 173 Rev 174
Line 72... Line 72...
72
static void Com_ParseReceivedMessage(Can_Message_t *canMsg) {
72
static void Com_ParseReceivedMessage(Can_Message_t *canMsg) {
73
    /*
73
    /*
74
     * Prepare a COM message.
74
     * Prepare a COM message.
75
     */
75
     */
76
    Com_Message_t comMsg;
76
    Com_Message_t comMsg;
-
 
77
    /* Unpack the header fields */
77
    comMsg.Funct =  (canMsg->Id & 0x1E000000L) >> 25;   /* bit[25..28] */
78
    comMsg.Funct =  (canMsg->Id & 0x1E000000L) >> 25;   /* bit[25..28] */
78
    comMsg.Funcc =  (canMsg->Id & 0x01FF8000L) >> 15;   /* bit[15..24] */
79
    comMsg.Funcc =  (canMsg->Id & 0x01FF8000L) >> 15;   /* bit[15..24] */
79
    comMsg.Nid =    (canMsg->Id & 0x00007E00L) >> 9;    /* bit[9..14] */
80
    comMsg.Nid =    (canMsg->Id & 0x00007E00L) >> 9;    /* bit[9..14] */
80
    comMsg.Sid =    (canMsg->Id & 0x000001FFL) >> 0;    /* bit[0..8] */
81
    comMsg.Sid =    (canMsg->Id & 0x000001FFL) >> 0;    /* bit[0..8] */
-
 
82
    /* Copy data */
-
 
83
    comMsg.Data.dwords[0] = canMsg->Data.dwords[0];
-
 
84
    comMsg.Data.dwords[1] = canMsg->Data.dwords[1];
81
   
85
   
82
    /*
86
    /*
83
     * Parse the COM message.
87
     * Parse the COM message.
84
     */
88
     */
85
    //TODO
89
    //TODO