equal
deleted
inserted
replaced
81 |
81 |
82 void __cleanup_%(locstr)s() |
82 void __cleanup_%(locstr)s() |
83 { |
83 { |
84 // Stop timer thread |
84 // Stop timer thread |
85 if(init_level-- > 0){ |
85 if(init_level-- > 0){ |
86 int init_level_c = init_level; |
86 int init_level_c = init_level; |
87 StopTimerLoop(&Exit); |
87 StopTimerLoop(&Exit); |
88 %(nodes_close)s |
88 %(nodes_close)s |
89 } |
89 } |
90 #if !defined(WIN32) || defined(__CYGWIN__) |
90 |
91 TimerCleanup(); |
91 TimerCleanup(); |
92 #endif |
|
93 } |
92 } |
94 |
93 |
95 #define NODE_OPEN(nodename)\ |
94 #define NODE_OPEN(nodename)\ |
96 if(!canOpen(&nodename##Board,&nodename##_Data)){\ |
95 if(!canOpen(&nodename##Board,&nodename##_Data)){\ |
97 fprintf(stderr,"Cannot open CAN intefrace %%s at speed %%s\n for CANopen node \"" #nodename "\"",nodename##Board.busname, nodename##Board.baudrate);\ |
96 fprintf(stderr,"Cannot open CAN intefrace %%s at speed %%s\n for CANopen node \"" #nodename "\"",nodename##Board.busname, nodename##Board.baudrate);\ |
108 fprintf(stderr, "Cannot load CAN interface library for CanFestival (%(candriver)s)\n");\ |
107 fprintf(stderr, "Cannot load CAN interface library for CanFestival (%(candriver)s)\n");\ |
109 fflush(stderr); |
108 fflush(stderr); |
110 return -1; |
109 return -1; |
111 } |
110 } |
112 #endif |
111 #endif |
113 #if !defined(WIN32) || defined(__CYGWIN__) |
112 |
114 TimerInit(); |
113 TimerInit(); |
115 #endif |
|
116 |
114 |
117 %(nodes_open)s |
115 %(nodes_open)s |
118 |
116 |
119 // Start timer thread |
117 // Start timer thread |
120 StartTimerLoop(&InitNodes); |
118 StartTimerLoop(&InitNodes); |