47 UNS8 DLL_CALL(canReceive)(CAN_HANDLE, Message *)FCT_PTR_INIT; |
47 UNS8 DLL_CALL(canReceive)(CAN_HANDLE, Message *)FCT_PTR_INIT; |
48 UNS8 DLL_CALL(canSend)(CAN_HANDLE, Message *)FCT_PTR_INIT; |
48 UNS8 DLL_CALL(canSend)(CAN_HANDLE, Message *)FCT_PTR_INIT; |
49 CAN_HANDLE DLL_CALL(canOpen)(s_BOARD *)FCT_PTR_INIT; |
49 CAN_HANDLE DLL_CALL(canOpen)(s_BOARD *)FCT_PTR_INIT; |
50 int DLL_CALL(canClose)(CAN_HANDLE)FCT_PTR_INIT; |
50 int DLL_CALL(canClose)(CAN_HANDLE)FCT_PTR_INIT; |
51 |
51 |
|
52 #if defined DEBUG_WAR_CONSOLE_ON || defined DEBUG_ERR_CONSOLE_ON || defined NEED_PRINT_MESSAGE |
|
53 #include "def.h" |
|
54 |
|
55 #define _P(fc) case fc: printf(#fc" ");break; |
|
56 |
|
57 static inline void print_message(Message *m) |
|
58 { |
|
59 int i; |
|
60 printf("id:%02x ", m->cob_id.w & 0x7F); |
|
61 UNS8 fc = m->cob_id.w >> 7; |
|
62 switch(fc) |
|
63 { |
|
64 _P(SYNC) |
|
65 _P(TIME_STAMP) |
|
66 _P(PDO1tx) |
|
67 _P(PDO1rx) |
|
68 _P(PDO2tx) |
|
69 _P(PDO2rx) |
|
70 _P(PDO3tx) |
|
71 _P(PDO3rx) |
|
72 _P(PDO4tx) |
|
73 _P(PDO4rx) |
|
74 _P(SDOtx) |
|
75 _P(SDOrx) |
|
76 _P(NODE_GUARD) |
|
77 _P(NMT) |
|
78 } |
|
79 if( fc == SDOtx) |
|
80 { |
|
81 switch(m->data[0] >> 5) |
|
82 { |
|
83 /* scs: server command specifier */ |
|
84 _P(UPLOAD_SEGMENT_RESPONSE) |
|
85 _P(DOWNLOAD_SEGMENT_RESPONSE) |
|
86 _P(INITIATE_DOWNLOAD_RESPONSE) |
|
87 _P(INITIATE_UPLOAD_RESPONSE) |
|
88 _P(ABORT_TRANSFER_REQUEST) |
|
89 } |
|
90 }else if( fc == SDOrx) |
|
91 { |
|
92 switch(m->data[0] >> 5) |
|
93 { |
|
94 /* ccs: client command specifier */ |
|
95 _P(DOWNLOAD_SEGMENT_REQUEST) |
|
96 _P(INITIATE_DOWNLOAD_REQUEST) |
|
97 _P(INITIATE_UPLOAD_REQUEST) |
|
98 _P(UPLOAD_SEGMENT_REQUEST) |
|
99 _P(ABORT_TRANSFER_REQUEST) |
|
100 } |
|
101 } |
|
102 printf(" rtr:%d", m->rtr); |
|
103 printf(" len:%d", m->len); |
|
104 for (i = 0 ; i < m->len ; i++) |
|
105 printf(" %02x", m->data[i]); |
|
106 printf("\n"); |
|
107 } |
|
108 |
52 #endif |
109 #endif |
|
110 |
|
111 #endif |