equal
deleted
inserted
replaced
62 if(!strcmp( optarg, "20K")) return CAN_BAUD_20K; |
62 if(!strcmp( optarg, "20K")) return CAN_BAUD_20K; |
63 if(!strcmp( optarg, "10K")) return CAN_BAUD_10K; |
63 if(!strcmp( optarg, "10K")) return CAN_BAUD_10K; |
64 if(!strcmp( optarg, "5K")) return CAN_BAUD_5K; |
64 if(!strcmp( optarg, "5K")) return CAN_BAUD_5K; |
65 if(!strcmp( optarg, "none")) return 0; |
65 if(!strcmp( optarg, "none")) return 0; |
66 return 0x0000; |
66 return 0x0000; |
67 } |
|
68 |
|
69 #define MyCase(fc) case fc: printf(#fc);break; |
|
70 void print_message(Message *m) |
|
71 { |
|
72 int i; |
|
73 switch(m->cob_id.w >> 7) |
|
74 { |
|
75 MyCase(SYNC) |
|
76 MyCase(TIME_STAMP) |
|
77 MyCase(PDO1tx) |
|
78 MyCase(PDO1rx) |
|
79 MyCase(PDO2tx) |
|
80 MyCase(PDO2rx) |
|
81 MyCase(PDO3tx) |
|
82 MyCase(PDO3rx) |
|
83 MyCase(PDO4tx) |
|
84 MyCase(PDO4rx) |
|
85 MyCase(SDOtx) |
|
86 MyCase(SDOrx) |
|
87 MyCase(NODE_GUARD) |
|
88 MyCase(NMT) |
|
89 } |
|
90 printf(" rtr:%d", m->rtr); |
|
91 printf(" len:%d", m->len); |
|
92 for (i = 0 ; i < m->len ; i++) |
|
93 printf(" %02x", m->data[i]); |
|
94 printf("\n"); |
|
95 } |
67 } |
96 |
68 |
97 void |
69 void |
98 canInit (s_BOARD *board) |
70 canInit (s_BOARD *board) |
99 { |
71 { |